소스 검색

no message

Fenix Wang 8 년 전
부모
커밋
12c0b27c38
90개의 변경된 파일1704개의 추가작업 그리고 632개의 파일을 삭제
  1. 2 2
      app/AndroidManifest.xml
  2. BIN
      app/res/drawable-hdpi/input_border.png
  3. BIN
      app/res/drawable-hdpi/ss_login_bg.png
  4. BIN
      app/res/drawable-hdpi/white_bordered_btn.png
  5. 3 4
      app/res/drawable/nim_white_round_button_selector.xml
  6. 2 6
      app/res/drawable/selector_textcolor_green_white.xml
  7. 10 0
      app/res/drawable/text_cursor.xml
  8. 1 11
      app/res/layout/circle_item.xml
  9. 26 8
      app/res/layout/circle_new_tweeting.xml
  10. 1 1
      app/res/layout/login_and_reg_layout.xml
  11. 199 145
      app/res/layout/login_and_reg_login_layout.xml
  12. 1 1
      app/res/layout/main.xml
  13. 45 19
      app/res/layout/mine_about_webview_activity.xml
  14. 6 5
      app/res/layout/mine_change_pwd_activity.xml
  15. 0 0
      app/res/layout/register_layout.xml
  16. 30 0
      app/res/layout/team_setttins.xml
  17. 12 10
      app/res/layout/trade_change_priority.xml
  18. 11 7
      app/res/layout/trade_list_search.xml
  19. 1 10
      app/res/layout/trade_recharge_activity.xml
  20. 4 0
      app/res/values/style.xml
  21. 6 4
      app/src/com/sheishuo/app/SheishuoApplication.java
  22. 2 0
      app/src/com/sheishuo/app/cache/AccountCache.java
  23. 21 0
      app/src/com/sheishuo/app/common/beans/TradeBean.java
  24. 1 1
      app/src/com/sheishuo/app/common/util/location/CityDataHelper.java
  25. 2 0
      app/src/com/sheishuo/app/common/util/net/INet.java
  26. 12 0
      app/src/com/sheishuo/app/common/util/net/JsonResponse.java
  27. 223 106
      app/src/com/sheishuo/app/common/util/net/NetImpl.java
  28. 2 0
      app/src/com/sheishuo/app/common/util/net/NetInfo.java
  29. 1 1
      app/src/com/sheishuo/app/common/util/net/ResponseCallback.java
  30. 3 3
      app/src/com/sheishuo/app/core_module/circle/activity/CircleDetailsActivity.java
  31. 41 7
      app/src/com/sheishuo/app/core_module/circle/activity/CirclePersonActivity.java
  32. 1 1
      app/src/com/sheishuo/app/core_module/circle/activity/NewCommentActivity.java
  33. 23 3
      app/src/com/sheishuo/app/core_module/circle/activity/NewTweetingActivity.java
  34. 5 4
      app/src/com/sheishuo/app/core_module/circle/model/NewTweetModel.java
  35. 2 2
      app/src/com/sheishuo/app/core_module/circle/presenter/NewTweetPresenter.java
  36. 1 1
      app/src/com/sheishuo/app/core_module/friends/activity/AddNewFriendActivity.java
  37. 1 1
      app/src/com/sheishuo/app/core_module/friends/activity/BeFollowedActivity.java
  38. 1 1
      app/src/com/sheishuo/app/core_module/friends/activity/ContactsListActivity.java
  39. 1 1
      app/src/com/sheishuo/app/core_module/friends/activity/PhoneContactsActivity.java
  40. 34 2
      app/src/com/sheishuo/app/core_module/mine/view/ui/activity/AboutWebViewActivity.java
  41. 8 7
      app/src/com/sheishuo/app/core_module/mine/view/ui/activity/ChangePwdActivity.java
  42. 1 1
      app/src/com/sheishuo/app/core_module/mine/view/ui/activity/FeedbackActivity.java
  43. 1 1
      app/src/com/sheishuo/app/core_module/mine/view/ui/activity/HobbySelectActivity.java
  44. 1 1
      app/src/com/sheishuo/app/core_module/mine/view/ui/activity/MineTradeActivity.java
  45. 3 3
      app/src/com/sheishuo/app/core_module/mine/view/ui/activity/MineUploadPhotoActivity.java
  46. 1 1
      app/src/com/sheishuo/app/core_module/mine/view/ui/activity/NearbyPeopleActivity.java
  47. 6 4
      app/src/com/sheishuo/app/core_module/mine/view/ui/activity/PersonalSettingsActivity.java
  48. 6 6
      app/src/com/sheishuo/app/core_module/mine/view/ui/activity/PrivacyActivity.java
  49. 1 1
      app/src/com/sheishuo/app/core_module/mine/view/ui/activity/SettingsActivity.java
  50. 2 2
      app/src/com/sheishuo/app/core_module/mine/view/ui/activity/UserInfoDetailActivity.java
  51. 1 1
      app/src/com/sheishuo/app/core_module/mine/view/ui/activity/UserInfoSettingActivity.java
  52. 1 1
      app/src/com/sheishuo/app/core_module/sheishuo/view/ui/MoreGroupsInTheAreaActivity.java
  53. 1 1
      app/src/com/sheishuo/app/core_module/sheishuo/view/ui/NearbyGroupActivity.java
  54. 156 2
      app/src/com/sheishuo/app/core_module/sheishuo/view/ui/TeamSettingsActivity.java
  55. 8 8
      app/src/com/sheishuo/app/core_module/trade/model/TradeModel.java
  56. 10 11
      app/src/com/sheishuo/app/core_module/trade/view/adapter/TradeItemAdapter.java
  57. 2 2
      app/src/com/sheishuo/app/core_module/trade/view/ui/activity/PayMethodActivity.java
  58. 16 0
      app/src/com/sheishuo/app/core_module/trade/view/ui/activity/RechargeActivity.java
  59. 17 9
      app/src/com/sheishuo/app/core_module/trade/view/ui/activity/TradeChangePriorityActivity.java
  60. 2 2
      app/src/com/sheishuo/app/core_module/trade/view/ui/activity/TradeDetailsActivity.java
  61. 57 16
      app/src/com/sheishuo/app/core_module/trade/view/ui/activity/TradePublishActivity.java
  62. 35 13
      app/src/com/sheishuo/app/core_module/trade/view/ui/activity/TradeSearchActivity.java
  63. 2 2
      app/src/com/sheishuo/app/impl/SheishuoTeamMessageActivity.java
  64. 206 8
      app/src/com/sheishuo/app/login/LoginActivity.java
  65. 1 42
      app/src/com/sheishuo/app/login/LoginAndRegActivity.java
  66. 11 9
      app/src/com/sheishuo/app/login/RegisterActivity.java
  67. 8 0
      app/src/com/sheishuo/app/login/beans/LoginBean.java
  68. 11 6
      app/src/com/sheishuo/app/main/activity/ForgetActivity.java
  69. 1 1
      app/src/com/sheishuo/app/main/activity/MainActivity.java
  70. 2 2
      app/src/com/sheishuo/app/main/activity/SystemMessageActivity.java
  71. 3 2
      app/src/com/sheishuo/app/main/activity/WelcomeActivity.java
  72. 1 1
      app/src/com/sheishuo/app/main/adapter/AreaGroupsAdapter.java
  73. 1 4
      app/src/com/sheishuo/app/main/adapter/CircleListAdapter.java
  74. 12 10
      app/src/com/sheishuo/app/main/fragment/AreaGroupsFragment.java
  75. 58 29
      app/src/com/sheishuo/app/main/fragment/CircleOfFriendsFragment.java
  76. 105 5
      app/src/com/sheishuo/app/main/fragment/HomeFragment.java
  77. 18 10
      app/src/com/sheishuo/app/main/fragment/MineFragment.java
  78. 1 1
      app/src/com/sheishuo/app/main/fragment/SessionListFragment.java
  79. 31 5
      app/src/com/sheishuo/app/main/fragment/TradeListFragment.java
  80. 3 3
      app/src/com/sheishuo/app/main/model/CircleModel.java
  81. 15 0
      uikit/res-ptr2/drawable-v21/btn_login_selector.xml
  82. 20 19
      uikit/res/layout/gift_panel.xml
  83. 8 0
      uikit/src/com/netease/nim/uikit/UIKitCache.java
  84. 30 0
      uikit/src/com/netease/nim/uikit/common/media/picker/PickImageHelper.java
  85. 28 0
      uikit/src/com/netease/nim/uikit/session/actions/PickImageAction.java
  86. 1 0
      uikit/src/com/netease/nim/uikit/session/activity/WatchPictureActivity.java
  87. 6 5
      uikit/src/com/netease/nim/uikit/session/helper/TeamNotificationHelper.java
  88. 16 4
      uikit/src/com/netease/nim/uikit/session/module/gift/GiftPanel.java
  89. 4 3
      uikit/src/com/netease/nim/uikit/session/module/input/InputPanel.java
  90. 28 1
      uikit/src/com/netease/nim/uikit/session/module/list/MessageListPanelEx.java

+ 2 - 2
app/AndroidManifest.xml

@@ -75,8 +75,8 @@
             android:required="false" />
 
         <!-- 登录界面 -->
-        <activity android:name=".login.LoginActivity" />
-        <activity android:name=".login.LoginAndRegActivity">
+        <activity android:name=".login.LoginAndRegActivity" />
+        <activity android:name=".login.LoginActivity">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
 

BIN
app/res/drawable-hdpi/input_border.png


BIN
app/res/drawable-hdpi/ss_login_bg.png


BIN
app/res/drawable-hdpi/white_bordered_btn.png


+ 3 - 4
app/res/drawable/nim_white_round_button_selector.xml

@@ -1,8 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <selector xmlns:android="http://schemas.android.com/apk/res/android">
 
-    <item android:drawable="@drawable/nim_white_round_button_pressed" android:state_pressed="true"></item>
-    <item android:drawable="@drawable/nim_white_round_button" android:state_enabled="false"></item>
-    <item android:drawable="@drawable/nim_white_round_button"></item>
-
+    <item android:state_pressed="true" android:drawable="@drawable/nim_white_round_button_pressed" />
+    <item android:state_enabled="false" android:drawable="@drawable/nim_white_round_button" />
+    <item android:drawable="@drawable/nim_white_round_button" />
 </selector>

+ 2 - 6
app/res/drawable/selector_textcolor_green_white.xml

@@ -1,10 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <selector xmlns:android="http://schemas.android.com/apk/res/android">
 
-    <item android:state_checked="false"
-        android:drawable="@color/green_4DC0A4"/>
-
-    <item android:state_checked="true"
-        android:drawable="@color/white"/>
-
+    <item android:state_checked="false" android:drawable="@color/green_4DC0A4" />
+    <item android:state_checked="true" android:drawable="@color/white" />
 </selector>

+ 10 - 0
app/res/drawable/text_cursor.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+
+    <size android:width="1dp" />
+
+    <span style="font-family: Arial, Helvetica, sans-serif;"><!-- 光标宽度可以自己定义 --></span>
+
+    <solid android:color="#ffffff" /><!-- 光标颜色可以自己定义 -->
+</shape>

+ 1 - 11
app/res/layout/circle_item.xml

@@ -81,20 +81,11 @@
                         android:orientation="vertical">
 
                         <TextView
-                            android:id="@+id/location_tv"
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            android:text="地点"
-                            android:textColor="@android:color/darker_gray"
-                            android:textSize="10sp"/>
-
-                        <TextView
                             android:id="@+id/date_tv"
                             android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
                             android:text="发布日期"
-                            android:textColor="@android:color/darker_gray"
-                            android:textSize="10sp"/>
+                            android:textColor="@android:color/darker_gray" />
                     </LinearLayout>
 
                     <LinearLayout
@@ -152,7 +143,6 @@
                             android:layout_width="wrap_content"
                             android:layout_height="match_parent"
                             android:gravity="center"
-                            android:text="评论"
                             android:textColor="@android:color/darker_gray"
                             android:textSize="13sp" />
 

+ 26 - 8
app/res/layout/circle_new_tweeting.xml

@@ -27,7 +27,7 @@
     <EditText
         android:id="@+id/new_tweet_content"
         android:layout_width="0dp"
-        android:layout_height="256dp"
+        android:layout_height="128dp"
         android:layout_marginEnd="8dp"
         android:layout_marginLeft="8dp"
         android:layout_marginRight="8dp"
@@ -73,21 +73,39 @@
         android:layout_marginLeft="8dp"
         android:layout_marginStart="8dp"
         android:layout_marginTop="8dp"
-        android:background="@color/grey_light_light"
-        android:padding="4dp"
+        android:gravity="center_vertical"
         app:layout_constraintLeft_toLeftOf="@+id/new_tweet_content"
         app:layout_constraintTop_toBottomOf="@+id/new_tweet_content">
 
-        <ImageView
+        <LinearLayout
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:src="@drawable/location" />
+            android:background="@color/grey_light_light"
+            android:gravity="center_vertical"
+            android:orientation="horizontal"
+            android:padding="4dp">
+
+            <ImageView
+                android:id="@+id/imageView6"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:src="@drawable/location" />
+
+            <TextView
+                android:id="@+id/new_tweet_location_tv"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="未定位"
+                android:textColor="@color/grey_light" />
+
+        </LinearLayout>
 
-        <TextView
-            android:id="@+id/new_tweet_location_tv"
+        <CheckBox
+            android:id="@+id/check_show_loc"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:text="未定位"
+            android:layout_marginLeft="10dp"
+            android:text="不显示位置"
             android:textColor="@color/grey_light" />
     </LinearLayout>
 </android.support.constraint.ConstraintLayout>

+ 1 - 1
app/res/layout/login_and_reg_layout.xml

@@ -35,7 +35,7 @@
             android:layout_marginRight="8dp"
             android:layout_marginStart="8dp"
             android:layout_marginTop="8dp"
-            android:text="SHEI SHUO"
+            android:text="SHUI SHUO"
             android:textAlignment="center"
             android:typeface="sans"
             app:layout_constraintLeft_toLeftOf="@+id/activity_login_an_reg_logo"

+ 199 - 145
app/res/layout/login_and_reg_login_layout.xml

@@ -2,163 +2,175 @@
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     xmlns:tools="http://schemas.android.com/tools"
-    android:fitsSystemWindows="true"
-    android:orientation="vertical"
     android:layout_width="match_parent"
-    android:layout_height="match_parent">
+    android:layout_height="match_parent"
+    android:fitsSystemWindows="true"
+    android:orientation="vertical">
 
-    <android.support.design.widget.AppBarLayout
-        android:id="@+id/app_bar_layout"
-        android:layout_width="match_parent"
+    <ImageView
+        android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:theme="@style/AppTheme.AppBarOverlay"
-        android:weightSum="1"
-        app:elevation="0dp"
-        app:layout_constraintHorizontal_bias="0.0"
-        app:layout_constraintLeft_toLeftOf="parent"
-        app:layout_constraintRight_toRightOf="parent"
-        app:layout_constraintTop_toTopOf="parent">
-
-        <android.support.v7.widget.Toolbar
-            android:id="@+id/toolbar"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_weight="1.21"
-            android:background="?attr/colorPrimary"
-            app:titleTextAppearance="@style/Toolbar.TitleText"></android.support.v7.widget.Toolbar>
-    </android.support.design.widget.AppBarLayout>
+        android:scaleType="centerCrop"
+        app:srcCompat="@drawable/ss_login_bg" />
 
     <LinearLayout
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:layout_marginTop="56dp"
-        android:orientation="vertical">
-
-        <TextView
-            android:id="@+id/textView3"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginLeft="15dp"
-            android:layout_marginTop="25dp"
-            android:text="欢迎来到谁说"
-            android:textSize="25sp"
-            android:textStyle="bold"
-            android:typeface="monospace"
-            app:layout_constraintLeft_toLeftOf="parent"
-            app:layout_constraintTop_toBottomOf="@+id/app_bar_layout" />
-
-        <TextView
-            android:id="@+id/textView4"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginLeft="15dp"
-            android:layout_marginTop="5dp"
-            android:text="请输入您的登录信息"
-            app:layout_constraintBottom_toTopOf="@+id/login_tel"
-            app:layout_constraintLeft_toLeftOf="parent"
-            app:layout_constraintTop_toBottomOf="@+id/textView3"
-            app:layout_constraintVertical_bias="0.074" />
-
-        <com.netease.nim.uikit.common.ui.widget.ClearableEditTextWithIcon
-            android:id="@+id/login_tel"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_marginLeft="15dp"
-            android:layout_marginRight="15dp"
-            android:layout_marginTop="30dp"
-            android:background="@android:drawable/editbox_background"
-            android:hint="@string/please_input_tel_num"
-            android:inputType="phone"
-            android:maxLines="1"
-            android:padding="15dp"
-            app:layout_constraintHorizontal_bias="0.117"
-            app:layout_constraintLeft_toLeftOf="@+id/app_bar_layout"
-            app:layout_constraintRight_toRightOf="@+id/app_bar_layout"
-            app:layout_constraintTop_toBottomOf="@+id/app_bar_layout" />
-
-        <com.netease.nim.uikit.common.ui.widget.ClearableEditTextWithIcon
-            android:id="@+id/login_password"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_marginLeft="15dp"
-            android:layout_marginRight="15dp"
-            android:layout_marginTop="20dp"
-            android:background="@android:drawable/editbox_background"
-            android:hint="@string/please_input_pwd"
-            android:inputType="textPassword"
-            android:maxLines="1"
-            android:padding="15dp"
-            app:layout_constraintHorizontal_bias="0.0"
-            app:layout_constraintLeft_toLeftOf="@+id/login_tel"
-            app:layout_constraintRight_toRightOf="@+id/login_tel"
-            app:layout_constraintTop_toBottomOf="@+id/login_tel" />
-
-        <TextView
-            android:id="@+id/forgot_password"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_gravity="right"
-            android:layout_marginRight="15dp"
-            android:layout_marginTop="9dp"
-            android:text="忘记密码?"
-            android:textColor="@color/grey_light"
-            app:layout_constraintRight_toRightOf="@+id/login_password"
-            app:layout_constraintTop_toBottomOf="@+id/login_password" />
-
-        <Button
-            android:id="@+id/login_btn"
-            style="@style/NormalBtnStyle"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_marginLeft="15dp"
-            android:layout_marginRight="15dp"
-            android:layout_marginTop="15dp"
-            android:text="@string/login"
-            app:layout_constraintHorizontal_bias="0.0"
-            app:layout_constraintLeft_toLeftOf="@+id/login_password"
-            app:layout_constraintRight_toRightOf="@+id/login_password"
-            app:layout_constraintTop_toBottomOf="@+id/login_password" />
+        android:gravity="center"
+        android:orientation="horizontal">
 
         <LinearLayout
-            android:layout_width="wrap_content"
+            android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:layout_gravity="center"
-            android:layout_marginTop="15dp"
-            android:gravity="center_vertical|center_horizontal|center"
-            android:orientation="horizontal">
+            android:orientation="vertical">
 
-
-            <RadioButton
-                android:id="@+id/agree_radio"
-                android:layout_width="wrap_content"
+            <ImageView
+                android:id="@+id/imageView8"
+                android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_weight="1"
-                android:checked="true"
-                android:text="登录代表您已同意"
-                android:textColor="@color/color_grey_666666"
-                android:textColorLink="@color/color_green_00ae8c"
-                app:buttonTint="@color/color_green_00ae8c" />
+                android:layout_marginTop="20dp"
+                app:srcCompat="@drawable/logo" />
 
             <TextView
-                android:id="@+id/agree_txt"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_gravity="bottom"
+                android:layout_marginBottom="5dp"
+                android:layout_marginTop="10dp"
+                android:text="带给你更有效的沟通"
+                android:textAlignment="center"
+                android:textColor="@color/white" />
+
+            <com.netease.nim.uikit.common.ui.widget.ClearableEditTextWithIcon
+                android:id="@+id/login_tel"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="15dp"
+                android:layout_marginRight="15dp"
+                android:layout_marginTop="30dp"
+                android:background="@drawable/input_border"
+                android:hint="@string/please_input_tel_num"
+                android:inputType="phone"
+                android:maxLines="1"
+                android:padding="15dp"
+                android:textColor="@color/white"
+                android:textColorHint="@color/white"
+                app:layout_constraintHorizontal_bias="0.117"
+                app:layout_constraintLeft_toLeftOf="@+id/app_bar_layout"
+                app:layout_constraintRight_toRightOf="@+id/app_bar_layout"
+                app:layout_constraintTop_toBottomOf="@+id/app_bar_layout" />
+
+            <com.netease.nim.uikit.common.ui.widget.ClearableEditTextWithIcon
+                android:id="@+id/login_password"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="15dp"
+                android:layout_marginRight="15dp"
+                android:layout_marginTop="20dp"
+                android:background="@drawable/input_border"
+                android:hint="@string/please_input_pwd"
+                android:inputType="textPassword"
+                android:maxLines="1"
+                android:padding="15dp"
+                android:textColor="@color/white"
+                android:textColorHint="@color/white"
+                app:layout_constraintHorizontal_bias="0.0"
+                app:layout_constraintLeft_toLeftOf="@+id/login_tel"
+                app:layout_constraintRight_toRightOf="@+id/login_tel"
+                app:layout_constraintTop_toBottomOf="@+id/login_tel" />
+
+            <RelativeLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="15dp"
+                android:layout_marginRight="15dp"
+                android:layout_marginTop="10dp">
+
+                <TextView
+                    android:id="@+id/register_txt"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="bottom"
+                    android:layout_marginBottom="5dp"
+                    android:text="马上注册"
+                    android:textAlignment="textStart"
+                    android:textColor="@color/white" />
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:gravity="right"
+                    android:orientation="horizontal">
+
+                    <TextView
+                        android:id="@+id/forgot_password"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="right"
+                        android:text="忘记密码?"
+                        android:textColor="@color/white"
+                        app:layout_constraintRight_toRightOf="@+id/login_password"
+                        app:layout_constraintTop_toBottomOf="@+id/login_password" />
+                </LinearLayout>
+
+            </RelativeLayout>
+
+            <Button
+                android:id="@+id/login_btn"
+                style="@style/LoginBtnStyle"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="15dp"
+                android:layout_marginRight="15dp"
+                android:layout_marginTop="15dp"
+                android:text="@string/login"
+                app:layout_constraintHorizontal_bias="0.0"
+                app:layout_constraintLeft_toLeftOf="@+id/login_password"
+                app:layout_constraintRight_toRightOf="@+id/login_password"
+                app:layout_constraintTop_toBottomOf="@+id/login_password" />
+
+            <LinearLayout
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:layout_weight="1"
-                android:text="《用户注册协议》"
-                android:textColor="@color/color_green_00ae8c" />
+                android:layout_gravity="center"
+                android:layout_marginTop="15dp"
+                android:gravity="center_vertical|center_horizontal|center"
+                android:orientation="horizontal">
+
+
+                <RadioButton
+                    android:id="@+id/agree_radio"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1"
+                    android:checked="true"
+                    android:text="登录代表您已同意"
+                    android:textColor="@color/white"
+                    android:textColorLink="@color/color_green_00ae8c"
+                    app:buttonTint="@color/color_green_00ae8c" />
+
+                <TextView
+                    android:id="@+id/agree_txt"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1"
+                    android:text="《用户注册协议》"
+                    android:textColor="@color/white"
+                    android:textStyle="bold" />
+
+            </LinearLayout>
 
         </LinearLayout>
-
     </LinearLayout>
 
     <LinearLayout
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:gravity="center"
-        android:orientation="horizontal"
-        android:layout_alignParentTop="true"
         android:layout_alignParentLeft="true"
-        android:layout_alignParentStart="true">
+        android:layout_alignParentStart="true"
+        android:layout_alignParentTop="true"
+        android:gravity="center"
+        android:orientation="horizontal">
 
 
         <TextView
@@ -167,20 +179,62 @@
             android:layout_gravity="bottom"
             android:layout_marginBottom="5dp"
             android:layout_weight="1"
-            android:text="还没有账号?"
-            android:textAlignment="textEnd" />
+            android:text="谁说APP版权所有"
+            android:textAlignment="center"
+            android:textColor="@color/white" />
 
-        <TextView
-            android:id="@+id/register_txt"
-            android:layout_width="wrap_content"
+    </LinearLayout>
+
+    <RelativeLayout
+        android:id="@+id/intro_layout"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:background="@color/GreyWhite"
+        android:visibility="gone"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toTopOf="parent">
+
+        <android.support.v4.view.ViewPager
+            android:id="@+id/view_pager"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent">
+
+        </android.support.v4.view.ViewPager>
+
+        <LinearLayout
+            android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:layout_gravity="bottom"
-            android:layout_marginBottom="5dp"
-            android:layout_weight="1"
-            android:text="现在注册"
-            android:textAlignment="textStart"
-            android:textColor="@color/color_green_00ae8c" />
+            android:gravity="right"
+            android:orientation="horizontal"
+            android:paddingRight="5dp"
+            android:paddingTop="5dp">
+
+            <Button
+                android:id="@+id/skip_btn"
+                android:layout_width="60dp"
+                android:layout_height="40dp"
+                android:layout_weight="0"
+                android:text="跳过"
+                android:textColor="@color/white" />
 
-    </LinearLayout>
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:gravity="bottom"
+            android:orientation="horizontal">
+
+            <Button
+                android:id="@+id/start_btn"
+                android:layout_width="match_parent"
+                android:layout_height="60dp"
+                android:layout_marginBottom="15dp"
+                android:background="@null"
+                android:elevation="11dp" />
+        </LinearLayout>
 
+    </RelativeLayout>
 </RelativeLayout>

+ 1 - 1
app/res/layout/main.xml

@@ -167,7 +167,7 @@
                         android:layout_width="match_parent"
                         android:layout_height="wrap_content"
                         android:layout_marginTop="28dp"
-                        android:text="快讯广告"
+                        android:text="快讯"
                         android:textAlignment="center"
                         android:textSize="11sp" />
 

+ 45 - 19
app/res/layout/mine_about_webview_activity.xml

@@ -26,28 +26,54 @@
         android:id="@+id/mine_about_webview_agreement_layout"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:orientation="horizontal"
+        android:orientation="vertical"
         android:visibility="gone">
 
-        <Button
-            android:id="@+id/mine_about_webview_agree"
-            android:layout_width="0dp"
-            android:layout_height="wrap_content"
-            android:layout_margin="8dp"
-            android:layout_weight="1"
-            android:background="@drawable/btn1_selector"
-            android:text="取消"
-            android:textColor="@color/white" />
-
-        <Button
-            android:id="@+id/mine_about_webview_reject"
-            android:layout_width="0dp"
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:layout_gravity="center"
+            android:layout_marginTop="15dp"
+            android:orientation="horizontal">
+
+
+            <RadioButton
+                android:id="@+id/agree_radio"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:checked="true"
+                android:text="我已阅读并同意以上规定"
+                android:textColor="@color/color_grey_666666"
+                android:textColorLink="@color/color_green_00ae8c"
+                app:buttonTint="@color/color_green_00ae8c" />
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:layout_margin="8dp"
-            android:layout_weight="1"
-            android:background="@drawable/btn1_selector"
-            android:text="实名认证"
-            android:textColor="@color/white" />
+            android:orientation="horizontal">
+
+            <Button
+                android:id="@+id/mine_about_webview_reject"
+                android:layout_width="0dp"
+                android:layout_height="wrap_content"
+                android:layout_margin="8dp"
+                android:layout_weight="1"
+                android:background="@drawable/btn1_selector"
+                android:text="取消"
+                android:textColor="@color/white" />
+
+            <Button
+                android:id="@+id/mine_about_webview_agree"
+                android:layout_width="0dp"
+                android:layout_height="wrap_content"
+                android:layout_margin="8dp"
+                android:layout_weight="1"
+                android:background="@drawable/btn1_selector"
+                android:text="实名认证"
+                android:textColor="@color/white" />
+        </LinearLayout>
+
     </LinearLayout>
 
 </LinearLayout>

+ 6 - 5
app/res/layout/mine_change_pwd_activity.xml

@@ -23,6 +23,7 @@
         android:layout_height="match_parent"
         android:orientation="vertical"
         android:padding="16dp">
+
         <EditText
             android:id="@+id/mine_change_pwd_old_ET"
             android:layout_width="match_parent"
@@ -49,13 +50,13 @@
             android:inputType="textPassword"/>
 
 
-        <Button
-            android:id="@+id/mine_change_pwd_submit_btn"
+        <TextView
+            android:id="@+id/mine_change_pwd_tips"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:text="确认修改"
-            android:textColor="@color/white"
-            android:background="@drawable/btn1_selector" />
+            android:layout_marginTop="20dp"
+            android:text="安全等级低:数字和字母,长度8位  \n安全等级中:长度10位  \n安全等级高:包含大写字母,长度12位"
+            android:textColor="@color/grey_light" />
     </LinearLayout>
 
 </LinearLayout>

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
app/res/layout/register_layout.xml


+ 30 - 0
app/res/layout/team_setttins.xml

@@ -26,6 +26,34 @@
             android:orientation="vertical">
 
             <LinearLayout
+                android:id="@+id/team_settings_room_avatar_layout"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:gravity="center_vertical"
+                android:orientation="horizontal"
+                android:padding="16dp">
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="9"
+                    android:text="群聊头像"
+                    android:textSize="16sp" />
+
+                <com.netease.nim.uikit.common.ui.imageview.HeadImageView
+                    android:id="@+id/team_settings_avatar"
+                    android:layout_width="56dp"
+                    android:layout_height="56dp"
+                    android:textSize="30sp"
+                    android:textStyle="bold" />
+            </LinearLayout>
+
+            <View
+                android:layout_width="match_parent"
+                android:layout_height="1dp"
+                android:background="@color/grey_light_light" />
+
+            <LinearLayout
                 android:id="@+id/team_settings_room_name_layout"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
@@ -46,6 +74,7 @@
                     android:layout_height="wrap_content"
                     android:layout_weight="1"
                     android:text="群聊名称"
+                    android:textAlignment="textEnd"
                     android:textColor="@color/grey_light"
                     android:textSize="16sp" />
             </LinearLayout>
@@ -104,6 +133,7 @@
                     android:layout_height="wrap_content"
                     android:layout_weight="1"
                     android:text="99人"
+                    android:textAlignment="textEnd"
                     android:textColor="@color/grey_light"
                     android:textSize="16sp" />
 

+ 12 - 10
app/res/layout/trade_change_priority.xml

@@ -23,25 +23,27 @@
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_gravity="center"
-            android:orientation="horizontal"
-            android:padding="8dp">
+            android:orientation="vertical"
+            android:padding="15dp">
+
+            <TextView
+                android:id="@+id/trade_change_priority_tv"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_gravity="center"
+                android:layout_weight="9"
+                android:text="x 1 国家道具"
+                android:textColor="@color/black" />
 
             <SeekBar
                 android:id="@+id/trade_change_priority_seekBar"
-                android:layout_width="0dp"
+                android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:layout_gravity="center"
                 android:layout_weight="9"
                 android:max="100"
                 android:progress="1" />
 
-            <TextView
-                android:id="@+id/trade_change_priority_tv"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_gravity="center"
-                android:layout_weight="1"
-                android:text="x 1 国家道具" />
         </LinearLayout>
 
         <TextView

+ 11 - 7
app/res/layout/trade_list_search.xml

@@ -18,24 +18,28 @@
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_weight="9"
+            android:focusable="true"
+            android:focusableInTouchMode="true"
             android:hint="请输入搜索内容"
-            android:textColorHint="@color/white"
-            android:maxLines="1"
+            android:imeOptions="actionSearch"
             android:inputType="text"
-            android:imeOptions="actionDone">
-            <requestFocus/>
+            android:maxLines="1"
+            android:cursorVisible="true"
+            android:textCursorDrawable="@drawable/text_cursor"
+            android:textColorHint="@color/white"
+            android:textColor="@color/white">
         </EditText>
         <ImageView
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:src="@drawable/ic_action_search"/>
+
         <TextView
             android:id="@+id/trade_list_search"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:text="搜索"
-            android:textSize="18sp"
+            android:text="取消"
             android:textColor="@color/white"
-            />
+            android:textSize="18sp" />
     </LinearLayout>
 </LinearLayout>

+ 1 - 10
app/res/layout/trade_recharge_activity.xml

@@ -14,7 +14,7 @@
 
     <GridLayout
         android:id="@+id/recharge_grid"
-        android:layout_width="match_parent"
+        android:layout_width="385dp"
         android:layout_height="wrap_content"
         android:columnCount="3"
         android:padding="15dp">
@@ -22,7 +22,6 @@
         <LinearLayout
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_columnWeight="1"
             android:background="@drawable/ico_recharge_unchecked"
             android:gravity="center"
             android:orientation="vertical">
@@ -46,7 +45,6 @@
         <LinearLayout
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_columnWeight="1"
             android:layout_marginLeft="10dp"
             android:layout_marginRight="10dp"
             android:background="@drawable/ico_recharge_unchecked"
@@ -72,7 +70,6 @@
         <LinearLayout
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_columnWeight="1"
             android:background="@drawable/ico_recharge_unchecked"
             android:gravity="center"
             android:orientation="vertical">
@@ -94,9 +91,7 @@
         </LinearLayout>
 
         <LinearLayout
-            android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_columnWeight="1"
             android:layout_marginTop="10dp"
             android:background="@drawable/ico_recharge_unchecked"
             android:gravity="center"
@@ -119,9 +114,7 @@
         </LinearLayout>
 
         <LinearLayout
-            android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_columnWeight="1"
             android:layout_marginLeft="10dp"
             android:layout_marginRight="10dp"
             android:layout_marginTop="10dp"
@@ -146,9 +139,7 @@
         </LinearLayout>
 
         <LinearLayout
-            android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_columnWeight="1"
             android:layout_marginTop="10dp"
             android:background="@drawable/ico_recharge_unchecked"
             android:gravity="center"

+ 4 - 0
app/res/values/style.xml

@@ -9,6 +9,10 @@
         <!--<item name="colorAccent">@color/colorAccent</item>-->
     <!--</style>-->
 
+    <style name="LoginBtnStyle">
+        <item name="android:background">@drawable/btn_login_selector</item>
+        <item name="android:textColor">@color/colorPrimary</item>
+    </style>
 
     <style name="NormalBtnStyle">
         <item name="android:background">@drawable/btn1_selector</item>

+ 6 - 4
app/src/com/sheishuo/app/SheishuoApplication.java

@@ -1,5 +1,6 @@
 package com.sheishuo.app;
 
+import android.app.ActivityManager;
 import android.app.Application;
 import android.content.BroadcastReceiver;
 import android.content.Context;
@@ -7,11 +8,15 @@ import android.content.Intent;
 import android.content.IntentFilter;
 import android.graphics.Color;
 import android.os.Environment;
+import android.os.Handler;
 import android.support.multidex.MultiDex;
 import android.text.TextUtils;
 import android.util.Log;
+import android.view.View;
 
 import com.netease.nim.uikit.ContextCache;
+import com.netease.nim.uikit.common.ui.dialog.DialogMaker;
+import com.netease.nim.uikit.common.ui.dialog.EasyAlertDialogHelper;
 import com.sheishuo.app.avchat.AVChatProfile;
 import com.sheishuo.app.common.util.location.CityDataHelper;
 import com.sheishuo.app.config.preference.UserPreferences;
@@ -55,6 +60,7 @@ import com.netease.nimlib.sdk.team.constant.TeamFieldEnum;
 import com.netease.nimlib.sdk.team.model.IMMessageFilter;
 import com.netease.nimlib.sdk.team.model.UpdateTeamAttachment;
 
+import java.util.List;
 import java.util.Map;
 
 public class SheishuoApplication extends Application {
@@ -62,18 +68,14 @@ public class SheishuoApplication extends Application {
     private static final String TAG = "SheishuoApplication";
     private static Context context;
 
-
-
     protected void attachBaseContext(Context newBase) {
         super.attachBaseContext(newBase);
         MultiDex.install(this);
     }
 
-
     public void onCreate() {
         super.onCreate();
 
-
         context = this;
 
         ContextCache.init(context);

+ 2 - 0
app/src/com/sheishuo/app/cache/AccountCache.java

@@ -14,6 +14,8 @@ public class AccountCache{
 
     private static LoginBean.DBean account;
 
+    public static int lastPulishedTradeId;
+
     public static void setCache(LoginBean.DBean account){
         AccountCache.account =account;
     }

+ 21 - 0
app/src/com/sheishuo/app/common/beans/TradeBean.java

@@ -156,6 +156,27 @@ public class TradeBean implements Serializable{
                 this.priority_type = priority_type;
             }
 
+            public String getLocal()
+            {
+                if(priority_type.equals("0"))
+                {
+                    return "全国";
+                }
+                else if(priority_type.equals("1"))
+                {
+                    return "全省";
+                }
+                else if(priority_type.equals("2"))
+                {
+                    return "全市";
+                }
+                else if(priority_type.equals("3"))
+                {
+                    return "本地";
+                }
+                return "";
+            }
+
             public String getPriority() {
                 return priority;
             }

+ 1 - 1
app/src/com/sheishuo/app/common/util/location/CityDataHelper.java

@@ -58,7 +58,7 @@ public class CityDataHelper {
 //            }
 //
 //            @Override
-//            public void onFailed() {
+//            public void onFailed(String error) {
 //                Log.e("CityDataHelper","init failed");
 //            }
 //        });

+ 2 - 0
app/src/com/sheishuo/app/common/util/net/INet.java

@@ -36,6 +36,7 @@ public interface INet {
     void getNearbyPeople(String userId,String page,ResponseCallback callback);
     void getCircleList(String targetId,String lastId,ResponseCallback callback);
     void getTradeList(int type,int page,ResponseCallback callback);
+    void getTradeInfo(String id, ResponseCallback callback);
     void searchTrade(String key,int type,int page,ResponseCallback callback);
     void publishTrade(int type,String content,String pics,int priority,int priorityType,String roomId,ResponseCallback callback);
     void deleteTrade(String tradeId, ResponseCallback callback);
@@ -54,6 +55,7 @@ public interface INet {
     void forgetPassword(String mobile, String code, String pwd, ResponseCallback callback);
     void updateAlias(String targetId, String alias, ResponseCallback callback);
     void fetchAlias(String targetIds, ResponseCallback callback);
+    void updateNick(String nick, ResponseCallback callback);
 
     //follow
     void followOrUnfollow(String targetId);

+ 12 - 0
app/src/com/sheishuo/app/common/util/net/JsonResponse.java

@@ -0,0 +1,12 @@
+package com.sheishuo.app.common.util.net;
+
+import org.json.JSONObject;
+
+/**
+ * Created by KN on 2017/7/14.
+ */
+
+public interface JsonResponse {
+    void onSuccess(JSONObject json);
+    void onFailed(String error);
+}

+ 223 - 106
app/src/com/sheishuo/app/common/util/net/NetImpl.java

@@ -1,12 +1,17 @@
 package com.sheishuo.app.common.util.net;
 
 import android.graphics.Bitmap;
+import android.os.Handler;
 import android.support.annotation.Nullable;
 import android.util.Log;
+import android.view.View;
 
 import com.google.gson.Gson;
 import com.google.gson.reflect.TypeToken;
+import com.netease.nim.uikit.ContextCache;
+import com.netease.nim.uikit.UIKitCache;
 import com.netease.nim.uikit.cache.NimUserInfoCache;
+import com.netease.nim.uikit.common.ui.dialog.EasyAlertDialog;
 import com.netease.nim.uikit.common.ui.dialog.EasyAlertDialogHelper;
 import com.sheishuo.app.SheishuoApplication;
 import com.sheishuo.app.cache.AccountCache;
@@ -75,11 +80,11 @@ public class NetImpl implements INet {
             if ( 200 == response.code()){
                 callback.onSuccess(response.body().string());
             }else {
-                callback.onFailed();
+                callback.onFailed(null);
             }
         } catch (IOException e) {
             e.printStackTrace();
-            callback.onFailed();
+            callback.onFailed(null);
         }
     }
 
@@ -96,12 +101,12 @@ public class NetImpl implements INet {
             if (200 == response.code()) {
                 callback.onSuccess(response.body().string());
             } else {
-                callback.onFailed();
+                callback.onFailed(null);
             }
 
         } catch (IOException e) {
             e.printStackTrace();
-            callback.onFailed();
+            callback.onFailed(null);
         }
     }
 
@@ -118,15 +123,55 @@ public class NetImpl implements INet {
             if (200 == response.code()) {
                 callback.onSuccess(response.body().string());
             } else {
-                callback.onFailed();
+                callback.onFailed(null);
             }
 
         } catch (IOException e) {
             e.printStackTrace();
-            callback.onFailed();
+            callback.onFailed(null);
         }
     }
 
+    private void postCall(final FormBody body, final String url, final JsonResponse jsonResponse)
+    {
+        new Thread(new Runnable() {
+            @Override
+            public void run() {
+                String error = "";
+                try {
+                    Request request = new Request.Builder()
+                            .post(body)
+                            .url(url)
+                            .build();
+
+                    Response response = client.newCall(request).execute();
+                    int responseCode = response.code();
+                    if (200 == responseCode){
+                        String resultStr = response.body().string();
+                        Log.i("JsonResponse", resultStr);
+                        JSONObject result = new JSONObject(resultStr);
+                        int c = result.getInt("c");
+                        if(c == 0)
+                        {
+                            JSONObject d = result.getJSONObject("d");
+                            if(jsonResponse != null)
+                                jsonResponse.onSuccess(d);
+                            return;
+                        }
+                        else
+                        {
+                            error = result.getString("d");
+                        }
+                    }
+                }catch (Exception e){
+                    e.printStackTrace();
+                }
+                if(jsonResponse != null)
+                    jsonResponse.onFailed(error);
+            }
+        }).start();
+    }
+
     @Override
     public void updateLatitudeAndLongitude(final double longitude, final double latitude, final ResponseCallback callback) {
         new Thread(new Runnable() {
@@ -164,13 +209,13 @@ public class NetImpl implements INet {
                             callback.onSuccess(null);
                         }
                     }else {
-                        callback.onFailed();
+                        callback.onFailed(null);
                     }
 
 
                 }catch (Exception e){
                     e.printStackTrace();
-                    callback.onFailed();
+                    callback.onFailed(null);
                 }
             }
         }).start();
@@ -199,11 +244,11 @@ public class NetImpl implements INet {
                         String resultStr = response.body().string();
                         callback.onSuccess(resultStr);
                     }else{
-                        callback.onFailed();
+                        callback.onFailed(null);
                     }
                 } catch (Exception e) {
                     e.printStackTrace();
-                    callback.onFailed();
+                    callback.onFailed(null);
 
                 }
 
@@ -234,23 +279,26 @@ public class NetImpl implements INet {
                     Response response = client.newCall(request).execute();
 
                     if (200 == response.code()) {
-                        LoginBean bean = gson.fromJson(response.body().string(), LoginBean.class);
+                        String result = response.body().string();
+                        Log.d("NetResult", result);
+                        LoginBean bean = gson.fromJson(result, LoginBean.class);
                         bean.getD().setAutoJoinRoom(true);
+                        gson.fromJson(result, UIKitCache.AccountBean.class);
                         switch (bean.getC()) {
                             case 0:
                                 callback.onSuccess(bean);
                                 break;
                             default:
-                                callback.onFailed();
+                                callback.onFailed(null);
                                 break;
                         }
                     } else {
-                        callback.onFailed();
+                        callback.onFailed(null);
                     }
 
                 } catch (Exception e) {
                     e.printStackTrace();
-                    callback.onFailed();
+                    callback.onFailed(null);
                 }
             }
         }
@@ -279,12 +327,12 @@ public class NetImpl implements INet {
                         String code = new JSONObject(resultStr).getJSONObject("d").getString("obj");
                         callback.onSuccess(code);
                     }else {
-                        callback.onFailed();
+                        callback.onFailed(null);
                     }
 
                 }catch (Exception e){
                     e.printStackTrace();
-                    callback.onFailed();
+                    callback.onFailed(null);
                 }
             }
         }).start();
@@ -311,12 +359,12 @@ public class NetImpl implements INet {
                     if (200 == response.code()){
                         callback.onSuccess(null);
                     }else {
-                        callback.onFailed();
+                        callback.onFailed(null);
                     }
 
                 }catch (Exception e){
                     e.printStackTrace();
-                    callback.onFailed();
+                    callback.onFailed(null);
                 }
 
 
@@ -345,12 +393,12 @@ public class NetImpl implements INet {
                     if (200 == response.code()){
                         callback.onSuccess(null);
                     }else {
-                        callback.onFailed();
+                        callback.onFailed(null);
                     }
 
                 }catch (Exception e){
                     e.printStackTrace();
-                    callback.onFailed();
+                    callback.onFailed(null);
                 }
 
 
@@ -389,11 +437,11 @@ public class NetImpl implements INet {
                     }
                     else
                     {
-                        callback.onFailed();
+                        callback.onFailed(null);
                     }
                 }catch (Exception e){
                     e.printStackTrace();
-                    callback.onFailed();
+                    callback.onFailed(null);
                 }
 
 
@@ -402,6 +450,30 @@ public class NetImpl implements INet {
     }
 
     @Override
+    public void updateNick(final String nick, final ResponseCallback callback) {
+
+        FormBody body = new FormBody.Builder()
+                .add("user_id", AccountCache.getAccount().getId())
+                .add("nick", nick)
+                .build();
+
+        postCall(body, NICK_URL, new JsonResponse() {
+            @Override
+            public void onSuccess(JSONObject json) {
+
+                if(callback != null)
+                    callback.onSuccess(null);
+            }
+
+            @Override
+            public void onFailed(String error) {
+                if(callback != null)
+                    callback.onFailed(error);
+            }
+        });
+    }
+
+    @Override
     public void changePwd(final String pwd, final String newPwd, final ResponseCallback callback) {
         new Thread(new Runnable() {
             @Override
@@ -421,6 +493,7 @@ public class NetImpl implements INet {
                     Response response = client.newCall(request).execute();
                     if (200 == response.code()){
                         String resultStr = response.body().string();
+                        Log.e("NetRes", resultStr);
                         JSONObject data = new JSONObject(resultStr).getJSONObject("d");
                         Boolean isUpdate = data.getBoolean("update");
                         int security = data.has("security") ? data.getInt("security") : 0;
@@ -428,16 +501,16 @@ public class NetImpl implements INet {
                         if (isUpdate){
                             callback.onSuccess(null);
                         }else {
-                            callback.onFailed();
+                            callback.onFailed(null);
                         }
 
                     }else {
-                        callback.onFailed();
+                        callback.onFailed(null);
                     }
 
                 }catch (Exception e){
                     e.printStackTrace();
-                    callback.onFailed();
+                    callback.onFailed(null);
                 }
 
 
@@ -464,12 +537,12 @@ public class NetImpl implements INet {
                         GiftBean.DBean gift = (new Gson().fromJson(result, GiftBean.class)).getD();
                         callback.onSuccess(gift);
                     } else {
-                        callback.onFailed();
+                        callback.onFailed(null);
                     }
 
                 } catch (Exception e) {
                     e.printStackTrace();
-                    callback.onFailed();
+                    callback.onFailed(null);
                 }
             }
         }).start();
@@ -503,7 +576,7 @@ public class NetImpl implements INet {
         call.enqueue(new Callback() {
             @Override
             public void onFailure(Call call, IOException e) {
-                callback.onFailed();
+                callback.onFailed(null);
                 e.printStackTrace();
             }
 
@@ -515,11 +588,11 @@ public class NetImpl implements INet {
                         int imgCode = jsonObject.getJSONObject("d").getInt("aid");
                         callback.onSuccess(imgCode);
                     } else {
-                        callback.onFailed();
+                        callback.onFailed(null);
                     }
                 } catch (JSONException e) {
                     e.printStackTrace();
-                    callback.onFailed();
+                    callback.onFailed(null);
                 }
             }
         });
@@ -546,7 +619,7 @@ public class NetImpl implements INet {
         call.enqueue(new Callback() {
             @Override
             public void onFailure(Call call, IOException e) {
-                callback.onFailed();
+                callback.onFailed(null);
                 e.printStackTrace();
             }
 
@@ -566,11 +639,11 @@ public class NetImpl implements INet {
                         photo.setPic(data.getString("pic"));
                         callback.onSuccess(photo);
                     } else {
-                        callback.onFailed();
+                        callback.onFailed(null);
                     }
                 } catch (JSONException e) {
                     e.printStackTrace();
-                    callback.onFailed();
+                    callback.onFailed(null);
                 }
             }
         });
@@ -594,11 +667,11 @@ public class NetImpl implements INet {
                     if (200 == response.code()) {
                         callback.onSuccess(null);
                     } else {
-                        callback.onFailed();
+                        callback.onFailed(null);
                     }
                 } catch (IOException e) {
                     e.printStackTrace();
-                    callback.onFailed();
+                    callback.onFailed(null);
                 }
             }
         }).start();
@@ -633,17 +706,17 @@ public class NetImpl implements INet {
 
                         } catch (JSONException e) {
                             e.printStackTrace();
-                            callback.onFailed();
+                            callback.onFailed(null);
                         }
 
 
 
                     } else {
-                        callback.onFailed();
+                        callback.onFailed(null);
                     }
                 } catch (IOException e) {
                     e.printStackTrace();
-                    callback.onFailed();
+                    callback.onFailed(null);
                 }
             }
         }).start();
@@ -672,7 +745,7 @@ public class NetImpl implements INet {
                     callback.onSuccess(likedBean);
                 }catch (Exception e){
                     e.printStackTrace();
-                    callback.onFailed();
+                    callback.onFailed(null);
                 }
             }
         }).start();
@@ -714,7 +787,7 @@ public class NetImpl implements INet {
 
                 }catch (Exception e){
                     e.printStackTrace();
-                    callback.onFailed();
+                    callback.onFailed(null);
                 }
             }
         }).start();
@@ -748,7 +821,7 @@ public class NetImpl implements INet {
 
                 }catch (Exception e){
                     e.printStackTrace();
-                    callback.onFailed();
+                    callback.onFailed(null);
                 }
             }
         }).start();
@@ -770,12 +843,12 @@ public class NetImpl implements INet {
                         String resultStr = response.body().string();
                         callback.onSuccess(resultStr);
                     }else {
-                        callback.onFailed();
+                        callback.onFailed(null);
                     }
 
                 }catch (Exception e){
                     e.printStackTrace();
-                    callback.onFailed();
+                    callback.onFailed(null);
                 }
             }
         }).start();
@@ -803,12 +876,12 @@ public class NetImpl implements INet {
                         Log.e("result",result);
                         callback.onSuccess(result);
                     }else {
-                        callback.onFailed();
+                        callback.onFailed(null);
                     }
 
                 }catch (Exception e){
                     e.printStackTrace();
-                    callback.onFailed();
+                    callback.onFailed(null);
                 }
 
             }
@@ -841,11 +914,11 @@ public class NetImpl implements INet {
                         CircleBean bean = new Gson().fromJson(result, CircleBean.class);
                         callback.onSuccess(bean);
                     }else {
-                        callback.onFailed();
+                        callback.onFailed(null);
                     }
                 }catch (Exception e){
                     e.printStackTrace();
-                    callback.onFailed();
+                    callback.onFailed(null);
                 }
 
             }
@@ -878,15 +951,59 @@ public class NetImpl implements INet {
                         if (0 != bean.getD().getList().size()){
                             callback.onSuccess(bean);
                         }else {
-                            callback.onFailed();
+                            callback.onFailed(null);
                         }
                     }else{
-                        callback.onFailed();
+                        callback.onFailed(null);
                     }
 
                 }catch (Exception e){
                     e.printStackTrace();
-                    callback.onFailed();
+                    callback.onFailed(null);
+                }
+            }
+        }).start();
+    }
+
+    @Override
+    public void getTradeInfo(String id, final ResponseCallback callback) {
+        final FormBody body = new FormBody.Builder()
+                .add("user_id", AccountCache.getAccount().getId())
+                .add("id", id)
+                .build();
+
+        final Request request = new Request.Builder()
+                .url(NetInfo.TRADE_INFO)
+                .post(body)
+                .build();
+
+        new Thread(new Runnable() {
+            @Override
+            public void run() {
+                try {
+                    Response response = client.newCall(request).execute();
+                    if (200 == response.code()){
+                        String json = response.body().string();
+                        Log.d("TradeInfo", json);
+                        JSONObject jsonObject = new JSONObject(json);
+                        int c = jsonObject.getInt("c");
+                        if(c == 0)
+                        {
+                            JSONObject d = jsonObject.getJSONObject("d");
+                            TradeBean.DBean.ListBean bean = new Gson().fromJson(d.toString(), TradeBean.DBean.ListBean.class);
+                            callback.onSuccess(bean);
+                        }
+                        else
+                        {
+                            callback.onFailed(null);
+                        }
+                    }else{
+                        callback.onFailed(null);
+                    }
+
+                }catch (Exception e){
+                    e.printStackTrace();
+                    callback.onFailed(null);
                 }
             }
         }).start();
@@ -917,7 +1034,7 @@ public class NetImpl implements INet {
                     callback.onSuccess(bean);
                 }catch (Exception e){
                     e.printStackTrace();
-                    callback.onFailed();
+                    callback.onFailed(null);
                 }
             }
         }).start();
@@ -949,19 +1066,16 @@ public class NetImpl implements INet {
                     response = client.newCall(request).execute();
                     if (200 == response.code()){
                         String resultJson = response.body().string();
+                        Log.d("NetResult", resultJson);
                         callback.onSuccess(resultJson);
                     }else {
-                        callback.onFailed();
+                        callback.onFailed(null);
                     }
                 } catch (Exception e) {
                     e.printStackTrace();
-                    callback.onFailed();
+                    callback.onFailed(null);
                 }
 
-
-
-
-
             }
         }).start();
     }
@@ -989,11 +1103,11 @@ public class NetImpl implements INet {
                         String resultJson = response.body().string();
                         callback.onSuccess(resultJson);
                     }else {
-                        callback.onFailed();
+                        callback.onFailed(null);
                     }
                 } catch (Exception e) {
                     e.printStackTrace();
-                    callback.onFailed();
+                    callback.onFailed(null);
                 }
 
 
@@ -1034,15 +1148,15 @@ public class NetImpl implements INet {
                             CircleBean.DBean.ListBean.Comment comment = gson.fromJson(dataStr, CircleBean.DBean.ListBean.Comment.class);
                             callback.onSuccess(comment);
                         }else {
-                            callback.onFailed();
+                            callback.onFailed(null);
                         }
                     }else {
-                        callback.onFailed();
+                        callback.onFailed(null);
                     }
 
                 }catch (Exception e){
                     e.printStackTrace();
-                    callback.onFailed();
+                    callback.onFailed(null);
                 }
             }
         }).start();
@@ -1071,7 +1185,7 @@ public class NetImpl implements INet {
                 call.enqueue(new Callback() {
                     @Override
                     public void onFailure(Call call, IOException e) {
-                        callback.onFailed();
+                        callback.onFailed(null);
                         e.printStackTrace();
                     }
 
@@ -1082,11 +1196,11 @@ public class NetImpl implements INet {
                             if (jsonObject.getInt("c") == 0) {
                                 callback.onSuccess("");
                             } else {
-                                callback.onFailed();
+                                callback.onFailed(null);
                             }
                         } catch (JSONException e) {
                             e.printStackTrace();
-                            callback.onFailed();
+                            callback.onFailed(null);
                         }
                     }
                 });
@@ -1119,12 +1233,12 @@ public class NetImpl implements INet {
                         List<ContactRelationshipBean> list = new Gson().fromJson(resultJson,new TypeToken<List<ContactRelationshipBean>>(){}.getType());
                         callback.onSuccess(list);
                     }else{
-                        callback.onFailed();
+                        callback.onFailed(null);
                     }
 
                 }catch (Exception e){
                     e.printStackTrace();
-                    callback.onFailed();
+                    callback.onFailed(null);
                 }
             }
         }).start();
@@ -1226,11 +1340,11 @@ public class NetImpl implements INet {
                         SocialInfoCache.initFollowList(list);
                         callback.onSuccess(SocialInfoCache.followList());
                     } else {
-                        callback.onFailed();
+                        callback.onFailed(null);
                     }
                 }catch (Exception e){
                     e.printStackTrace();
-                    callback.onFailed();
+                    callback.onFailed(null);
                 }
             }
         }).start();
@@ -1258,11 +1372,11 @@ public class NetImpl implements INet {
                         BeFollowedBean bean = gson.fromJson(resultStr, BeFollowedBean.class);
                         callback.onSuccess(bean);
                     } else {
-                        callback.onFailed();
+                        callback.onFailed(null);
                     }
                 }catch (Exception e){
                     e.printStackTrace();
-                    callback.onFailed();
+                    callback.onFailed(null);
                 }
             }
         }).start();
@@ -1287,22 +1401,25 @@ public class NetImpl implements INet {
         String hobby = bean.getHobby();
         String address = bean.getAddress();
 
-        FormBody body = new FormBody.Builder()
-                .add("user_id",user_id)
-                .add("age",age)
-                .add("show_age",show_age)
-                .add("real_name",real_name)
-                .add("id_number",id_number)
-                .add("add_verify",add_verify)
-                .add("find_mobile",find_mobile)
-                .add("find_id",find_id)
-                .add("find_nick",find_nick)
-                .add("see_social",see_social)
-                .add("effect",effect)
-                .add("hobby",hobby)
-                .add("address",address)
-                .build();
-
+        FormBody.Builder builder = new FormBody.Builder();
+        if(add_verify != null) builder.add("add_verify",add_verify);
+
+        builder.add("user_id",user_id);
+        builder.add("age",age);
+        builder.add("show_age",show_age);
+        builder.add("real_name",real_name);
+        builder.add("id_number",id_number);
+        //builder.add("add_verify",add_verify);
+        builder.add("find_mobile",find_mobile);
+        builder.add("find_id",find_id);
+        builder.add("find_nick",find_nick);
+        builder.add("see_social",see_social);
+        builder.add("effect",effect);
+        builder.add("hobby",hobby);
+        builder.add("address",address);
+        builder.build();
+
+        FormBody body = builder.build();
         final Request request = new Request.Builder()
                 .post(body)
                 .url(UPDATE_SOCIAL_INFO)
@@ -1325,15 +1442,15 @@ public class NetImpl implements INet {
                             final String error = jsonObject.getString("d");
                             if(error != null && error.length() > 0)
                                 callback.onSuccess(error);
-                            callback.onFailed();
+                            callback.onFailed(null);
                         }
                     }else {
-                        callback.onFailed();
+                        callback.onFailed(null);
                     }
 
                 } catch (Exception e) {
                     e.printStackTrace();
-                    callback.onFailed();
+                    callback.onFailed(null);
                 }
             }
         }).start();
@@ -1373,11 +1490,11 @@ public class NetImpl implements INet {
 
 
                     } else {
-                        callback.onFailed();
+                        callback.onFailed(null);
                     }
                 }catch (Exception e){
                     e.printStackTrace();
-                    callback.onFailed();
+                    callback.onFailed(null);
                 }
             }
         }).start();
@@ -1459,12 +1576,12 @@ public class NetImpl implements INet {
                         String resultStr = response.body().string();
                         callback.onSuccess(resultStr);
                     }else {
-                        callback.onFailed();
+                        callback.onFailed(null);
                     }
 
                 }catch (Exception e){
                     e.printStackTrace();
-                    callback.onFailed();
+                    callback.onFailed(null);
                 }
             }
         }).start();
@@ -1491,12 +1608,12 @@ public class NetImpl implements INet {
                         RequestBean bean = gson.fromJson(response.body().string(), RequestBean.class);
                         callback.onSuccess(bean);
                     }else {
-                        callback.onFailed();
+                        callback.onFailed(null);
                     }
 
                 }catch (Exception e){
                     e.printStackTrace();
-                    callback.onFailed();
+                    callback.onFailed(null);
                 }
             }
         }).start();
@@ -1521,12 +1638,12 @@ public class NetImpl implements INet {
                     if (200 == response.code()){
                         callback.onSuccess(null);
                     }else {
-                        callback.onFailed();
+                        callback.onFailed(null);
                     }
 
                 }catch (Exception e){
                     e.printStackTrace();
-                    callback.onFailed();
+                    callback.onFailed(null);
                 }
             }
         }).start();
@@ -1551,12 +1668,12 @@ public class NetImpl implements INet {
                     if (200 == response.code()){
                         callback.onSuccess(null);
                     }else {
-                        callback.onFailed();
+                        callback.onFailed(null);
                     }
 
                 }catch (Exception e){
                     e.printStackTrace();
-                    callback.onFailed();
+                    callback.onFailed(null);
                 }
             }
         }).start();
@@ -1587,14 +1704,14 @@ public class NetImpl implements INet {
                         }
                         else
                         {
-                            callback.onFailed();
+                            callback.onFailed(null);
                         }
                     } else {
-                        callback.onFailed();
+                        callback.onFailed(null);
                     }
                 }catch (Exception e){
                     e.printStackTrace();
-                    callback.onFailed();
+                    callback.onFailed(null);
                 }
             }
         }).start();
@@ -1636,14 +1753,14 @@ public class NetImpl implements INet {
                         }
                         else
                         {
-                            callback.onFailed();
+                            callback.onFailed(null);
                         }
                     } else {
-                        callback.onFailed();
+                        callback.onFailed(null);
                     }
                 }catch (Exception e){
                     e.printStackTrace();
-                    callback.onFailed();
+                    callback.onFailed(null);
                 }
             }
         }).start();

+ 2 - 0
app/src/com/sheishuo/app/common/util/net/NetInfo.java

@@ -20,6 +20,7 @@ public class NetInfo {
     public final static String UPLOAD_SOCIAL_PHOTO = INDEX + "?m=who&c=social&a=photo_upload";
     public final static String DELETE_SOCIAL_PHOTO = INDEX + "?m=who&c=social&a=photo_delete";
     public final static String TRADE_LIST = INDEX + "?m=who&c=trade&a=lists";
+    public final static String TRADE_INFO = INDEX + "?m=who&c=trade&a=info";
     public final static String TRADE_EDIT = INDEX + "?m=who&c=trade&a=edit";
     public final static String FOLLOW_TRADE = INDEX + "?m=who&c=trade&a=follow";
     public final static String UNFOLLOW_TRADE = INDEX + "?m=who&c=trade&a=delete_follow";
@@ -51,6 +52,7 @@ public class NetInfo {
     public final static String FORGET_URL = INDEX + "?m=who&c=index&a=forget";
     public final static String ALIAS_URL = INDEX + "?m=who&c=social&a=update_alias";
     public final static String FETCH_ALIAS_URL = INDEX + "?m=who&c=social&a=fetch_alias";
+    public final static String NICK_URL = INDEX + "?m=who&c=social&a=update_nick";
 
     //follow
     public final static String FOLLOW_OR_UNFOLLOW_USER = INDEX + "?m=who&c=social&a=follow";

+ 1 - 1
app/src/com/sheishuo/app/common/util/net/ResponseCallback.java

@@ -6,5 +6,5 @@ package com.sheishuo.app.common.util.net;
 
 public interface ResponseCallback {
     void onSuccess(Object object);
-    void onFailed();
+    void onFailed(String error);
 }

+ 3 - 3
app/src/com/sheishuo/app/core_module/circle/activity/CircleDetailsActivity.java

@@ -293,7 +293,7 @@ public class CircleDetailsActivity extends SheishuoUI {
                     }
 
                     @Override
-                    public void onFailed() {
+                    public void onFailed(String error) {
                         showToast(getBaseContext(), "加载失败");
                     }});
     }
@@ -370,7 +370,7 @@ public class CircleDetailsActivity extends SheishuoUI {
                             }
 
                             @Override
-                            public void onFailed() {
+                            public void onFailed(String error) {
                                 showToast(context, "删除失败");
                             }});
                     }
@@ -415,7 +415,7 @@ public class CircleDetailsActivity extends SheishuoUI {
             }
 
             @Override
-            public void onFailed() {
+            public void onFailed(String error) {
                 showToast(context, "点赞失败");
             }
         });

+ 41 - 7
app/src/com/sheishuo/app/core_module/circle/activity/CirclePersonActivity.java

@@ -26,6 +26,9 @@ import com.sheishuo.app.SheishuoApplication;
 import com.sheishuo.app.cache.AccountCache;
 import com.sheishuo.app.cache.SocialInfoCache;
 import com.sheishuo.app.common.beans.CircleBean;
+import com.sheishuo.app.common.beans.SocialInfoBean;
+import com.sheishuo.app.common.util.net.NetImpl;
+import com.sheishuo.app.common.util.net.ResponseCallback;
 import com.sheishuo.app.common.views.BaseToolbar;
 import com.sheishuo.app.core_module.mine.view.ui.activity.UserInfoDetailActivity;
 import com.sheishuo.app.impl.SheishuoUI;
@@ -47,7 +50,7 @@ public class CirclePersonActivity extends SheishuoUI {
     private CirclePresenter presenter = new CirclePresenter(this);
 
     private RecyclerView recyclerView;
-    private ImageView avatar,backgroundImg;
+    private ImageView avatar, backgroundImg;
     private TextView username;
     private BaseToolbar toolbar;
     private MainActivity parent;
@@ -67,6 +70,7 @@ public class CirclePersonActivity extends SheishuoUI {
         Intent intent = new Intent();
         intent.setClass(context, CirclePersonActivity.class);
         intent.putExtra(EXTRA_DATA_USER_ID, targetId);
+        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
         context.startActivity(intent);
     }
 
@@ -86,14 +90,44 @@ public class CirclePersonActivity extends SheishuoUI {
         NimUserInfo user = NIMClient.getService(UserService.class).getUserInfo(targetId);
         String avatarUrl = user.getAvatar();
         Glide.with(SheishuoApplication.getContext()).load(avatarUrl).into(avatar);
+        username.setText(user.getName());
+
+        SocialInfoBean socialInfoBean = SocialInfoCache.get(targetId);
+        if (socialInfoBean == null) {
+            new NetImpl().getSocialInfo(targetId, new ResponseCallback() {
+                @Override
+                public void onSuccess(Object object) {
+                    updateTop();
+                }
 
-        String banner = SocialInfoCache.get(targetId).getSocial_banner();
-        Glide.with(this)
-                .load(banner)
-                .centerCrop()
-                .into(backgroundImg);
+                @Override
+                public void onFailed(String error) {
 
-        username.setText(user.getName());
+                }
+            });
+        }
+        else
+        {
+            updateTop();
+        }
+    }
+
+    private void updateTop()
+    {
+        final SocialInfoBean socialInfoBean = SocialInfoCache.get(targetId);
+        if(socialInfoBean == null)
+            return;
+
+        getHandler().post(new Runnable() {
+            @Override
+            public void run() {
+                String banner = socialInfoBean.getSocial_banner();
+                Glide.with(backgroundImg.getContext())
+                        .load(banner)
+                        .centerCrop()
+                        .into(backgroundImg);
+            }
+        });
     }
 
 

+ 1 - 1
app/src/com/sheishuo/app/core_module/circle/activity/NewCommentActivity.java

@@ -93,7 +93,7 @@ public class NewCommentActivity extends SheishuoUI{
                     }
 
                     @Override
-                    public void onFailed() {
+                    public void onFailed(String error) {
                         showToast(context,"评论失败");
                         finish();
                     }

+ 23 - 3
app/src/com/sheishuo/app/core_module/circle/activity/NewTweetingActivity.java

@@ -10,6 +10,8 @@ import android.view.MotionEvent;
 import android.view.View;
 import android.view.ViewGroup;
 import android.view.inputmethod.InputMethodManager;
+import android.widget.CheckBox;
+import android.widget.CompoundButton;
 import android.widget.EditText;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
@@ -22,6 +24,7 @@ import com.netease.nim.uikit.common.media.picker.model.PhotoInfo;
 import com.netease.nim.uikit.common.ui.dialog.DialogMaker;
 import com.netease.nim.uikit.common.ui.dialog.EasyAlertDialog;
 import com.netease.nim.uikit.common.ui.dialog.EasyAlertDialogHelper;
+import com.netease.nim.uikit.session.activity.WatchPictureActivity;
 import com.netease.nim.uikit.session.constant.Extras;
 import com.sheishuo.app.R;
 import com.sheishuo.app.cache.AccountCache;
@@ -56,6 +59,8 @@ public class NewTweetingActivity extends SheishuoUI {
     private List<String> selectedPhotoPathList;
     private List<Integer> photoIds;
     private Toast toast = null;
+    private boolean showLoc = true;
+    private CheckBox checkBoxShowLoc;
 //    private static MainActivity activity;
 
     private int maxNumImages = 9;
@@ -103,6 +108,7 @@ public class NewTweetingActivity extends SheishuoUI {
         locationTV = (TextView) findViewById(R.id.new_tweet_location_tv);
         imgsLayout = (LinearLayout) findViewById(R.id.new_tweet_img_layout);
         addImg = (ImageView) findViewById(R.id.new_tweet_add_imgs);
+        checkBoxShowLoc = (CheckBox) findViewById(R.id.check_show_loc);
     }
 
     private void init() {
@@ -135,7 +141,14 @@ public class NewTweetingActivity extends SheishuoUI {
 //
 //        Log.e(TAG, "location ===> " + LocationHelper.getLatitude() + "   " + LocationHelper.getLongitude());
         locationTV.setText(AccountCache.getAccount().getCity() + AccountCache.getAccount().getDistrict());
-
+        checkBoxShowLoc.setChecked(!showLoc);
+        checkBoxShowLoc.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
+            @Override
+            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+                showLoc = !isChecked;
+                Log.d("show loc", ""+showLoc);
+            }
+        });
 
         //初始化照片添加监听事件
         selectedPhotoPathList = new ArrayList<>();
@@ -201,7 +214,7 @@ public class NewTweetingActivity extends SheishuoUI {
     }
 
 
-    private ImageView createImageView(String filePath)
+    private ImageView createImageView(final String filePath)
     {
         int imgSize = (int) ImgUtil.convertDpToPixel(60, context);
         selectedPhotoPathList.add(filePath);
@@ -240,6 +253,13 @@ public class NewTweetingActivity extends SheishuoUI {
             }
         });
 
+        imageView.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                WatchPictureActivity.start(context, selectedPhotoPathList, selectedPhotoPathList, selectedPhotoPathList.indexOf(filePath));
+            }
+        });
+
         Glide.with(context).load(filePath)
                 .into(imageView);
         imgsLayout.addView(imageView);
@@ -273,7 +293,7 @@ public class NewTweetingActivity extends SheishuoUI {
         getHandler().postDelayed(new Runnable() {
             @Override
             public void run() {
-                presenter.publishNewTweeting(tweetContent.getText().toString(), photoIds);
+                presenter.publishNewTweeting(tweetContent.getText().toString(), showLoc, photoIds);
             }
         },100);
     }

+ 5 - 4
app/src/com/sheishuo/app/core_module/circle/model/NewTweetModel.java

@@ -57,7 +57,7 @@ public class NewTweetModel {
                         }
 
                         @Override
-                        public void onFailed() {
+                        public void onFailed(String error) {
                             presenter.showToast("第" + (finalI + 1) + "张照片上传失败");
                         }
                     });
@@ -101,7 +101,7 @@ public class NewTweetModel {
                     }
 
                     @Override
-                    public void onFailed() {
+                    public void onFailed(String error) {
                         presenter.showToast("第" + (index + 1) + "张照片上传失败");
                         presenter.onPhotoUploadFailed(index);
                     }
@@ -111,7 +111,7 @@ public class NewTweetModel {
         }).start();
     }
 
-    public void publishNewTweeting(final String content,final List<Integer> photoIds){
+    public void publishNewTweeting(final String content, final boolean showLoc, final List<Integer> photoIds){
         NetStatus.IS_BUSY = true;
         new Thread(new Runnable() {
             @Override
@@ -134,6 +134,7 @@ public class NewTweetModel {
                         .add("id",accuont.getId())
                         .add("msg",content)
                         .add("local",accuont.getCity() + accuont.getDistrict())
+                        .add("show_local", showLoc ? "1" : "0")
                         .add("province", accuont.getProvince())
                         .add("city", accuont.getCity())
                         .add("district", accuont.getDistrict())
@@ -158,7 +159,7 @@ public class NewTweetModel {
                     }
 
                     @Override
-                    public void onFailed() {
+                    public void onFailed(String error) {
                         NetStatus.IS_BUSY = false;
                         presenter.showToast("发布失败");
                     }

+ 2 - 2
app/src/com/sheishuo/app/core_module/circle/presenter/NewTweetPresenter.java

@@ -42,8 +42,8 @@ public class NewTweetPresenter {
         activity.onAllPhotosUploaded();
     }
 
-    public void publishNewTweeting(String content,List<Integer> ids){
-        model.publishNewTweeting(content,ids);
+    public void publishNewTweeting(String content, boolean showLoc, List<Integer> ids){
+        model.publishNewTweeting(content, showLoc, ids);
     }
 
     public void onPhotoUploadFailed(int index)

+ 1 - 1
app/src/com/sheishuo/app/core_module/friends/activity/AddNewFriendActivity.java

@@ -72,7 +72,7 @@ public class AddNewFriendActivity extends SheishuoUI {
                         }
 
                         @Override
-                        public void onFailed() {
+                        public void onFailed(String error) {
                             showToast(context,"查找的用户不存在");
                         }
                     });

+ 1 - 1
app/src/com/sheishuo/app/core_module/friends/activity/BeFollowedActivity.java

@@ -85,7 +85,7 @@ public class BeFollowedActivity extends SheishuoUI {
             }
 
             @Override
-            public void onFailed() {
+            public void onFailed(String error) {
 
             }
         });

+ 1 - 1
app/src/com/sheishuo/app/core_module/friends/activity/ContactsListActivity.java

@@ -111,7 +111,7 @@ public class ContactsListActivity extends SheishuoUI {
             }
 
             @Override
-            public void onFailed() {
+            public void onFailed(String error) {
 
             }
         });

+ 1 - 1
app/src/com/sheishuo/app/core_module/friends/activity/PhoneContactsActivity.java

@@ -108,7 +108,7 @@ public class PhoneContactsActivity extends SheishuoUI {
             }
 
             @Override
-            public void onFailed() {
+            public void onFailed(String error) {
 
             }
         });

+ 34 - 2
app/src/com/sheishuo/app/core_module/mine/view/ui/activity/AboutWebViewActivity.java

@@ -7,10 +7,13 @@ import android.view.View;
 import android.webkit.WebView;
 import android.widget.Button;
 import android.widget.LinearLayout;
+import android.widget.RadioButton;
 
+import com.netease.nim.uikit.common.ui.dialog.EasyAlertDialogHelper;
 import com.sheishuo.app.R;
 import com.sheishuo.app.common.views.BaseToolbar;
 import com.sheishuo.app.impl.SheishuoUI;
+import com.sheishuo.app.login.LoginActivity;
 
 /**
  * Created by KN on 2017/8/28.
@@ -34,11 +37,14 @@ public class AboutWebViewActivity extends SheishuoUI{
     private LinearLayout agreementLayout;
 
     private Button agreeBtn,rejectBtn;
+    private RadioButton agreeRadio;
+    private boolean isAgree = true;
 
     private String title = "";
     private String url = "";
     private boolean isAgreement = false;
 
+
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
@@ -57,6 +63,7 @@ public class AboutWebViewActivity extends SheishuoUI{
         agreementLayout = findView(R.id.mine_about_webview_agreement_layout);
         agreeBtn = findView(R.id.mine_about_webview_agree);
         rejectBtn = findView(R.id.mine_about_webview_reject);
+        agreeRadio = findView(R.id.agree_radio);
     }
 
     void init(){
@@ -75,11 +82,17 @@ public class AboutWebViewActivity extends SheishuoUI{
         if (isAgreement){
             agreementLayout.setVisibility(View.VISIBLE);
 
+            agreeRadio.setOnClickListener(new View.OnClickListener() {
+                @Override
+                public void onClick(View v) {
+                    doAgreeCheck();
+                }
+            });
+
             agreeBtn.setOnClickListener(new View.OnClickListener() {
                 @Override
                 public void onClick(View v) {
-                    startActivity(new Intent(context,PersonalSettingsActivity.class));
-                    finish();
+                    onClickAgree();
                 }
             });
 
@@ -91,4 +104,23 @@ public class AboutWebViewActivity extends SheishuoUI{
             });
         }
     }
+
+    void doAgreeCheck()
+    {
+        isAgree = !isAgree;
+        agreeRadio.setChecked(isAgree);
+    }
+
+    private void onClickAgree()
+    {
+        if(!isAgree)
+        {
+            EasyAlertDialogHelper.showOneButtonDiolag(this, "提示",
+                    "你需要阅读并同意相关规定", "确认", false, null);
+            return;
+        }
+
+        startActivity(new Intent(context,PersonalSettingsActivity.class));
+        finish();
+    }
 }

+ 8 - 7
app/src/com/sheishuo/app/core_module/mine/view/ui/activity/ChangePwdActivity.java

@@ -5,6 +5,7 @@ import android.os.Bundle;
 import android.view.View;
 import android.widget.Button;
 import android.widget.EditText;
+import android.widget.TextView;
 
 import com.sheishuo.app.R;
 import com.sheishuo.app.cache.AccountCache;
@@ -26,9 +27,6 @@ public class ChangePwdActivity extends SheishuoUI {
 
     private EditText oldPwdET,newPwdET,confirmPwdET;
 
-    private Button submitBtn;
-
-
     private INet net = new NetImpl();
     @Override
     protected void onCreate(Bundle savedInstanceState) {
@@ -44,14 +42,13 @@ public class ChangePwdActivity extends SheishuoUI {
         oldPwdET = findView(R.id.mine_change_pwd_old_ET);
         newPwdET = findView(R.id.mine_change_pwd_new_ET);
         confirmPwdET = findView(R.id.mine_change_pwd_confirm_ET);
-        submitBtn = findView(R.id.mine_change_pwd_submit_btn);
     }
 
 
     void init(){
 
         BaseToolbar toolbar = findView(R.id.toolbar);
-        toolbar.setTitle("修改密码");
+        toolbar.setTitle("");
         toolbar.setBackOnClickListener(new View.OnClickListener(){
             @Override
             public void onClick(View v) {
@@ -59,7 +56,10 @@ public class ChangePwdActivity extends SheishuoUI {
             }
         });
 
-        submitBtn.setOnClickListener(new View.OnClickListener() {
+
+        TextView submitTxt = new TextView(getBaseContext());
+        submitTxt.setText("完成");
+        submitTxt.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
                 String oldPwd = oldPwdET.getText().toString();
@@ -90,12 +90,13 @@ public class ChangePwdActivity extends SheishuoUI {
                     }
 
                     @Override
-                    public void onFailed() {
+                    public void onFailed(String error) {
                         showToast(context,"密码修改失败,请重试");
 
                     }
                 });
             }
         });
+        toolbar.setRightItems(new View[]{submitTxt});
     }
 }

+ 1 - 1
app/src/com/sheishuo/app/core_module/mine/view/ui/activity/FeedbackActivity.java

@@ -146,7 +146,7 @@ public class FeedbackActivity extends SheishuoUI {
             }
 
             @Override
-            public void onFailed() {
+            public void onFailed(String error) {
                 showToast(context,"反馈失败,请重试!");
                 DialogMaker.dismissProgressDialog();
             }

+ 1 - 1
app/src/com/sheishuo/app/core_module/mine/view/ui/activity/HobbySelectActivity.java

@@ -104,7 +104,7 @@ public class HobbySelectActivity extends SheishuoUI {
             }
 
             @Override
-            public void onFailed() {
+            public void onFailed(String error) {
                 Log.e(TAG,"failed");
             }
         });

+ 1 - 1
app/src/com/sheishuo/app/core_module/mine/view/ui/activity/MineTradeActivity.java

@@ -160,7 +160,7 @@ public class MineTradeActivity extends SheishuoUI {
             }
 
             @Override
-            public void onFailed() {
+            public void onFailed(String error) {
                 showToast(context,"已无更多内容加载");
             }
         });

+ 3 - 3
app/src/com/sheishuo/app/core_module/mine/view/ui/activity/MineUploadPhotoActivity.java

@@ -88,7 +88,7 @@ public class MineUploadPhotoActivity extends SheishuoUI {
             }
 
             @Override
-            public void onFailed() {
+            public void onFailed(String error) {
                 showToast(context,"加载失败,请检查网络");
             }
         });
@@ -230,7 +230,7 @@ public class MineUploadPhotoActivity extends SheishuoUI {
                 }
 
                 @Override
-                public void onFailed() {
+                public void onFailed(String error) {
                     showToast(context,"第" + finalI1 + 1 + "上传失败");
                 }
             });
@@ -310,7 +310,7 @@ public class MineUploadPhotoActivity extends SheishuoUI {
             }
 
             @Override
-            public void onFailed() {
+            public void onFailed(String error) {
                 showToast(context,"删除失败");
             }
         });

+ 1 - 1
app/src/com/sheishuo/app/core_module/mine/view/ui/activity/NearbyPeopleActivity.java

@@ -89,7 +89,7 @@ public class NearbyPeopleActivity extends SheishuoUI{
             }
 
             @Override
-            public void onFailed() {
+            public void onFailed(String error) {
                 showToast(context,"附近的人加载失败");
             }
         });

+ 6 - 4
app/src/com/sheishuo/app/core_module/mine/view/ui/activity/PersonalSettingsActivity.java

@@ -17,6 +17,7 @@ import android.widget.TextView;
 import android.widget.Toast;
 
 import com.bumptech.glide.Glide;
+import com.netease.nim.uikit.ContextCache;
 import com.netease.nim.uikit.common.media.picker.PickImageHelper;
 import com.netease.nim.uikit.common.media.picker.model.PhotoInfo;
 import com.netease.nim.uikit.common.ui.dialog.DialogMaker;
@@ -172,7 +173,7 @@ public class PersonalSettingsActivity extends SheishuoUI {
             }
 
             @Override
-            public void onFailed() {
+            public void onFailed(String error) {
                 showToast(context, "更新设置失败,请重试");
             }
         };
@@ -399,7 +400,8 @@ public class PersonalSettingsActivity extends SheishuoUI {
                     fieldMap.put(UserInfoFieldEnum.Name, resultStr);
                     NIMClient.getService(UserService.class).updateUserInfo(fieldMap);
                     bean.setNick(resultStr);
-                    net.updateSocialInfo(bean, callback);
+                    AccountCache.getAccount().setNick(resultStr);
+                    net.updateNick(resultStr, callback);
                     break;
                 case REQUEST_AGE:
                     ageTV.setText(resultStr);
@@ -441,7 +443,7 @@ public class PersonalSettingsActivity extends SheishuoUI {
                 }
 
                 @Override
-                public void onFailed() {
+                public void onFailed(String error) {
                     showToast(context,"更新兴趣失败,请重试");
                 }
             });
@@ -496,7 +498,7 @@ public class PersonalSettingsActivity extends SheishuoUI {
                         public void onResult(int code, String url, Throwable exception) {
                             if (code == ResponseCode.RES_SUCCESS && !TextUtils.isEmpty(url)) {
                                 LogUtil.i(TAG, "upload avatar success, url =" + url);
-                                Glide.with(PersonalSettingsActivity.this).load(url)
+                                Glide.with(ContextCache.context).load(url)
                                         .centerCrop()
                                         .into(avatarImg);
                                 UserUpdateHelper.update(UserInfoFieldEnum.AVATAR, url, new RequestCallbackWrapper<Void>() {

+ 6 - 6
app/src/com/sheishuo/app/core_module/mine/view/ui/activity/PrivacyActivity.java

@@ -114,7 +114,7 @@ public class PrivacyActivity extends SheishuoUI {
                     }
 
                     @Override
-                    public void onFailed() {
+                    public void onFailed(String error) {
                                 showToast(context,"更新设置失败,请重试");
 
 
@@ -139,7 +139,7 @@ public class PrivacyActivity extends SheishuoUI {
                     }
 
                     @Override
-                    public void onFailed() {
+                    public void onFailed(String error) {
                         showToast(context,"更新设置失败,请重试");
 
                     }
@@ -164,7 +164,7 @@ public class PrivacyActivity extends SheishuoUI {
                     }
 
                     @Override
-                    public void onFailed() {
+                    public void onFailed(String error) {
                         showToast(context,"更新设置失败,请重试");
 
 
@@ -190,7 +190,7 @@ public class PrivacyActivity extends SheishuoUI {
                     }
 
                     @Override
-                    public void onFailed() {
+                    public void onFailed(String error) {
                         showToast(context,"更新设置失败,请重试");
 
 
@@ -216,7 +216,7 @@ public class PrivacyActivity extends SheishuoUI {
                     }
 
                     @Override
-                    public void onFailed() {
+                    public void onFailed(String error) {
                         showToast(context,"更新设置失败,请重试");
 
 
@@ -242,7 +242,7 @@ public class PrivacyActivity extends SheishuoUI {
                     }
 
                     @Override
-                    public void onFailed() {
+                    public void onFailed(String error) {
                         showToast(context,"更新设置失败,请重试");
 
 

+ 1 - 1
app/src/com/sheishuo/app/core_module/mine/view/ui/activity/SettingsActivity.java

@@ -96,7 +96,7 @@ public class SettingsActivity extends SheishuoUI {
                 SPHelper.remove(context,"pwd");
                 LogoutHelperBak.logout();
 
-                LoginAndRegActivity.start(context);
+                LoginActivity.start(context);
                 finish();
 
             }

+ 2 - 2
app/src/com/sheishuo/app/core_module/mine/view/ui/activity/UserInfoDetailActivity.java

@@ -136,7 +136,7 @@ public class UserInfoDetailActivity extends SheishuoUI {
                 }
 
                 @Override
-                public void onFailed() {
+                public void onFailed(String error) {
 
                 }
             });
@@ -305,7 +305,7 @@ public class UserInfoDetailActivity extends SheishuoUI {
             }
 
             @Override
-            public void onFailed() {
+            public void onFailed(String error) {
                 showToast(context, "加载动态失败");
             }
         });

+ 1 - 1
app/src/com/sheishuo/app/core_module/mine/view/ui/activity/UserInfoSettingActivity.java

@@ -205,7 +205,7 @@ public class UserInfoSettingActivity extends SheishuoUI {
                 }
 
                 @Override
-                public void onFailed() {
+                public void onFailed(String error) {
                     showToast(getBaseContext(), "设置备注名失败");
                     DialogMaker.dismissProgressDialog();
                 }

+ 1 - 1
app/src/com/sheishuo/app/core_module/sheishuo/view/ui/MoreGroupsInTheAreaActivity.java

@@ -104,7 +104,7 @@ public class MoreGroupsInTheAreaActivity extends SheishuoUI {
                         }
 
                         @Override
-                        public void onFailed() {
+                        public void onFailed(String error) {
                         }
                     });
                 }

+ 1 - 1
app/src/com/sheishuo/app/core_module/sheishuo/view/ui/NearbyGroupActivity.java

@@ -120,7 +120,7 @@ public class NearbyGroupActivity extends SheishuoUI {
                     }
 
                     @Override
-                    public void onFailed() {
+                    public void onFailed(String error) {
 
                     }
                 });

+ 156 - 2
app/src/com/sheishuo/app/core_module/sheishuo/view/ui/TeamSettingsActivity.java

@@ -5,7 +5,9 @@ import android.content.Context;
 import android.content.DialogInterface;
 import android.content.Intent;
 import android.os.Bundle;
+import android.os.Handler;
 import android.support.v7.app.AlertDialog;
+import android.text.TextUtils;
 import android.util.Log;
 import android.view.View;
 import android.widget.Button;
@@ -18,20 +20,27 @@ import android.widget.Toast;
 
 import com.bumptech.glide.Glide;
 import com.netease.nim.uikit.NimUIKit;
+import com.netease.nim.uikit.common.media.picker.PickImageHelper;
+import com.netease.nim.uikit.common.ui.dialog.DialogMaker;
 import com.netease.nim.uikit.common.ui.dialog.EasyAlertDialogHelper;
 import com.netease.nim.uikit.common.ui.imageview.HeadImageView;
+import com.netease.nim.uikit.common.util.log.LogUtil;
 import com.netease.nim.uikit.contact_selector.activity.ContactSelectActivity;
 import com.netease.nim.uikit.recent.RecentContactsFragment;
+import com.netease.nim.uikit.session.actions.PickImageAction;
 import com.netease.nim.uikit.session.helper.MessageListPanelHelper;
 import com.netease.nim.uikit.team.activity.AdvancedTeamInfoActivity;
 import com.netease.nim.uikit.team.activity.AdvancedTeamMemberActivity;
 import com.netease.nim.uikit.team.helper.TeamHelper;
+import com.netease.nimlib.sdk.AbortableFuture;
 import com.netease.nimlib.sdk.NIMClient;
 import com.netease.nimlib.sdk.RequestCallback;
+import com.netease.nimlib.sdk.RequestCallbackWrapper;
 import com.netease.nimlib.sdk.ResponseCode;
 import com.netease.nimlib.sdk.msg.MsgService;
 import com.netease.nimlib.sdk.msg.constant.SessionTypeEnum;
 import com.netease.nimlib.sdk.msg.model.RecentContact;
+import com.netease.nimlib.sdk.nos.NosService;
 import com.netease.nimlib.sdk.team.TeamService;
 import com.netease.nimlib.sdk.team.constant.TeamFieldEnum;
 import com.netease.nimlib.sdk.team.model.Team;
@@ -47,11 +56,13 @@ import com.sheishuo.app.common.util.net.ResponseCallback;
 import com.sheishuo.app.common.views.BaseToolbar;
 import com.sheishuo.app.core_module.friends.activity.FollowSelectActivity;
 import com.sheishuo.app.core_module.mine.view.ui.activity.UserInfoDetailActivity;
+import com.sheishuo.app.impl.SheishuoTeamMessageActivity;
 import com.sheishuo.app.impl.SheishuoUI;
 import com.sheishuo.app.login.LoginActivity;
 import com.sheishuo.app.session.activity.MessageHistoryActivity;
 import com.sheishuo.app.session.search.SearchMessageActivity;
 
+import java.io.File;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -68,13 +79,18 @@ public class TeamSettingsActivity extends SheishuoUI implements View.OnClickList
     public final static int MEMBER_REQUEST_CODE = 1103;
 
     private static final int REQUEST_CODE_CONTACT_SELECT = 103;
+    private static final int REQUEST_PICK_ICON  = 104;
+
+    private static final int ICON_TIME_OUT = 30000;
 
     private static String systemTeamIntro;
 
     private String TAG = this.getClass().getSimpleName();
     private Context context = this;
 
-    private LinearLayout teamNameLayout, teamIntroductionLayout, teamMemberCountLayout, teamMemberAvatarLayout, chatRecordLayout, clearChatRecordLayout;
+    private HeadImageView teamAvatar;
+
+    private LinearLayout teamAvatarLayout, teamNameLayout, teamIntroductionLayout, teamMemberCountLayout, teamMemberAvatarLayout, chatRecordLayout, clearChatRecordLayout;
 
     private TextView teamNameTV, teamIntroductionTV, getTeamIntroductionTitleTV, teamMemberCountTV;
 
@@ -86,6 +102,8 @@ public class TeamSettingsActivity extends SheishuoUI implements View.OnClickList
 
     private String teamRoomId = "";
 
+    private AbortableFuture<String> uploadFuture;
+
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
@@ -99,6 +117,8 @@ public class TeamSettingsActivity extends SheishuoUI implements View.OnClickList
 
 
     void findViews() {
+        teamAvatarLayout = findView(R.id.team_settings_room_avatar_layout);
+        teamAvatar = findView(R.id.team_settings_avatar);
         teamNameLayout = findView(R.id.team_settings_room_name_layout);
         teamIntroductionLayout = findView(R.id.team_settings_introduction_layout);
         teamMemberCountLayout = findView(R.id.team_settings_member_count_layout);
@@ -129,11 +149,44 @@ public class TeamSettingsActivity extends SheishuoUI implements View.OnClickList
             }
         });
 
+
         team = getTeamService().queryTeamBlock(teamRoomId);
         teamNameTV.setText(team.getName());
         teamIntroductionTV.setText(team.getIntroduce());
         teamMemberCountTV.setText(team.getMemberCount() + "人");
 
+        if(SheishuoTeamMessageActivity.isSystemTeam(team))
+        {
+            if (team.getName().contains("国家")) {
+                Glide.with(context).load(R.drawable.group_country).into(teamAvatar);
+            } else if (team.getName().contains("市") || team.getName().contains("省")) {
+                Glide.with(context).load(R.drawable.group_province_city).into(teamAvatar);
+            } else if (team.getName().contains("区") || team.getName().contains("县")) {
+                Glide.with(context).load(R.drawable.group_district).into(teamAvatar);
+            } else {
+                if (team.getIcon().isEmpty()) {
+                    Glide.with(context).load(R.drawable.nim_avatar_group).into(teamAvatar);
+                } else {
+                    Glide.with(context)
+                            .load(team.getIcon())
+                            .into(teamAvatar);
+                }
+            }
+        }
+        else
+        {
+            if (team.getIcon().isEmpty()) {
+                Glide.with(context).load(R.drawable.nim_avatar_group).into(teamAvatar);
+            } else {
+                Glide.with(context)
+                        .load(team.getIcon())
+                        .into(teamAvatar);
+            }
+            if(team.getCreator().equals(AccountCache.getAccount().getId()))
+            {
+                teamAvatarLayout.setOnClickListener(this);
+            }
+        }
 
         if (team.mute()) muteSwitch.setChecked(true);
         muteSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@@ -267,6 +320,9 @@ public class TeamSettingsActivity extends SheishuoUI implements View.OnClickList
         Intent texteditIntent = new Intent(TeamSettingsActivity.this, SettingTextEditActivity.class);
 
         switch (v.getId()) {
+            case R.id.team_settings_room_avatar_layout:
+                showSelector(com.netease.nim.uikit.R.string.set_head_image, REQUEST_PICK_ICON);
+                break;
             case R.id.team_settings_quit_btn:
                 getTeamService().quitTeam(teamRoomId);
                 finish();
@@ -285,6 +341,100 @@ public class TeamSettingsActivity extends SheishuoUI implements View.OnClickList
     }
 
 
+    /**
+     * 打开图片选择器
+     */
+    private void showSelector(int titleId, final int requestCode) {
+        PickImageHelper.PickImageOption option = new PickImageHelper.PickImageOption();
+        option.titleResId = titleId;
+        option.multiSelect = false;
+        option.crop = true;
+        option.cropOutputImageWidth = 720;
+        option.cropOutputImageHeight = 720;
+
+        PickImageHelper.pickImage(TeamSettingsActivity.this, requestCode, option);
+    }
+
+    /**
+     * 更新头像
+     */
+    private void updateTeamIcon(final String path) {
+        if (TextUtils.isEmpty(path)) {
+            return;
+        }
+
+        File file = new File(path);
+        if (file == null) {
+            return;
+        }
+        DialogMaker.showProgressDialog(this, null, null, true, new DialogInterface.OnCancelListener() {
+            @Override
+            public void onCancel(DialogInterface dialog) {
+                cancelUpload(com.netease.nim.uikit.R.string.team_update_cancel);
+            }
+        }).setCanceledOnTouchOutside(true);
+
+        LogUtil.i(TAG, "start upload icon, local file path=" + file.getAbsolutePath());
+        new Handler().postDelayed(outimeTask, ICON_TIME_OUT);
+        uploadFuture = NIMClient.getService(NosService.class).upload(file, PickImageAction.MIME_JPEG);
+        uploadFuture.setCallback(new RequestCallbackWrapper<String>() {
+            @Override
+            public void onResult(int code, final String url, Throwable exception) {
+                if (code == ResponseCode.RES_SUCCESS && !TextUtils.isEmpty(url)) {
+                    LogUtil.i(TAG, "upload icon success, url =" + url);
+
+                    NIMClient.getService(TeamService.class).updateTeam(team.getId(), TeamFieldEnum.ICON, url).setCallback(new RequestCallback<Void>() {
+                        @Override
+                        public void onSuccess(Void param) {
+                            DialogMaker.dismissProgressDialog();
+                            Toast.makeText(TeamSettingsActivity.this, com.netease.nim.uikit.R.string.update_success, Toast.LENGTH_SHORT).show();
+                            onUpdateDone();
+                            Glide.with(context)
+                                    .load(url)
+                                    .into(teamAvatar);
+                        }
+
+                        @Override
+                        public void onFailed(int code) {
+                            DialogMaker.dismissProgressDialog();
+                            Toast.makeText(TeamSettingsActivity.this, String.format(getString(com.netease.nim.uikit.R.string.update_failed), code), Toast.LENGTH_SHORT).show();
+                        }
+
+                        @Override
+                        public void onException(Throwable exception) {
+                            DialogMaker.dismissProgressDialog();
+                        }
+                    }); // 更新资料
+                } else {
+                    Toast.makeText(TeamSettingsActivity.this, com.netease.nim.uikit.R.string.team_update_failed, Toast
+                            .LENGTH_SHORT).show();
+                    onUpdateDone();
+                }
+            }
+        });
+    }
+
+    private void cancelUpload(int resId) {
+        if (uploadFuture != null) {
+            uploadFuture.abort();
+            Toast.makeText(TeamSettingsActivity.this, resId, Toast.LENGTH_SHORT).show();
+            onUpdateDone();
+        }
+    }
+
+    private Runnable outimeTask = new Runnable() {
+        @Override
+        public void run() {
+            cancelUpload(com.netease.nim.uikit.R.string.team_update_failed);
+        }
+    };
+
+    private void onUpdateDone() {
+        uploadFuture = null;
+        DialogMaker.dismissProgressDialog();
+    }
+
+
     private void updateTeamName(final String teamName) {
 
         getTeamService().updateTeam(teamRoomId, TeamFieldEnum.Name, teamName).setCallback(new RequestCallback<Void>() {
@@ -326,7 +476,7 @@ public class TeamSettingsActivity extends SheishuoUI implements View.OnClickList
                 }
 
                 @Override
-                public void onFailed() {
+                public void onFailed(String error) {
 
                 }
             });
@@ -394,6 +544,10 @@ public class TeamSettingsActivity extends SheishuoUI implements View.OnClickList
                         inviteMembers(selected);
                     }
                     break;
+                case REQUEST_PICK_ICON:
+                    String path = data.getStringExtra(com.netease.nim.uikit.session.constant.Extras.EXTRA_FILE_PATH);
+                    updateTeamIcon(path);
+                    break;
             }
         }
     }

+ 8 - 8
app/src/com/sheishuo/app/core_module/trade/model/TradeModel.java

@@ -82,7 +82,7 @@ public class TradeModel {
                     }
 
                     @Override
-                    public void onFailed() {
+                    public void onFailed(String error) {
                         presenter.showToast("加载失败,请检查网络");
                     }
                 });
@@ -119,7 +119,7 @@ public class TradeModel {
                     }
 
                     @Override
-                    public void onFailed() {
+                    public void onFailed(String error) {
 
                     }
                 });
@@ -156,7 +156,7 @@ public class TradeModel {
                     }
 
                     @Override
-                    public void onFailed() {
+                    public void onFailed(String error) {
 
                     }
                 });
@@ -189,7 +189,7 @@ public class TradeModel {
                         }
 
                         @Override
-                        public void onFailed() {
+                        public void onFailed(String error) {
                             presenter.showToast("第" + (finalI + 1) + "张照片上传失败");
                         }
                     });
@@ -231,7 +231,7 @@ public class TradeModel {
                     }
 
                     @Override
-                    public void onFailed() {
+                    public void onFailed(String error) {
                         presenter.showToast("第" + (index + 1) + "张照片上传失败");
                         presenter.onPhotoUploadFailed(index);
                     }
@@ -261,7 +261,7 @@ public class TradeModel {
                         try{
                             JSONObject resObj = new JSONObject(json);
                             JSONObject data = resObj.getJSONObject("d");
-                            int coin = data.getInt("coin");
+                            double coin = data.getDouble("coin");
                             AccountCache.getAccount().setCoin(""+coin);
 
                             int tradeId = data.getInt("id");
@@ -275,7 +275,7 @@ public class TradeModel {
                     }
 
                     @Override
-                    public void onFailed() {
+                    public void onFailed(String error) {
                         presenter.showToast("加载失败,请检查网络");
                     }
                 });
@@ -301,7 +301,7 @@ public class TradeModel {
                     }
 
                     @Override
-                    public void onFailed() {
+                    public void onFailed(String error) {
                         presenter.showToast("加载失败,请检查网络");
                     }
                 });

+ 10 - 11
app/src/com/sheishuo/app/core_module/trade/view/adapter/TradeItemAdapter.java

@@ -97,15 +97,15 @@ public class TradeItemAdapter extends RecyclerView.Adapter<TradeItemAdapter.Trad
         holder.content.setText(bean.getMsg());
         String highLightStr = "";
 
-        if (bean.getPriority_type().equals("0")) {
-            highLightStr = highLightStr + "[全国]";
-        } else if(bean.getPriority_type().equals("1")){
-            highLightStr = highLightStr + "[" + bean.getProvince() + "]";
-        } else if(bean.getPriority_type().equals("2")){
-            highLightStr = highLightStr + "[" + bean.getCity() + "]";
-        } else if(bean.getPriority_type().equals("3")){
-            highLightStr = highLightStr + "[" + bean.getDistrict() + "]";
-        }
+//        if (bean.getPriority_type().equals("0")) {
+//            highLightStr = highLightStr + "[全国]";
+//        } else if(bean.getPriority_type().equals("1")){
+//            highLightStr = highLightStr + "[" + bean.getProvince() + "]";
+//        } else if(bean.getPriority_type().equals("2")){
+//            highLightStr = highLightStr + "[" + bean.getCity() + "]";
+//        } else if(bean.getPriority_type().equals("3")){
+//            highLightStr = highLightStr + "[" + bean.getDistrict() + "]";
+//        }
 
         if (Integer.valueOf(bean.getType()) == TradeModel.TYPE_SELL) {
             highLightStr = highLightStr + "[出售]";
@@ -128,10 +128,9 @@ public class TradeItemAdapter extends RecyclerView.Adapter<TradeItemAdapter.Trad
 
         //设置置顶权限
         if (bean.getPriority() != null && Integer.valueOf(bean.getPriority()) > 0) {
-            holder.priority.setText("置顶x" + bean.getPrice());
+            holder.priority.setText(bean.getLocal() + "x" + bean.getPriority());
         }
 
-
         //判断是否为自己发布的交易帖,如果是才能编辑置顶加权
         if (bean.getUser_id().equals(AccountCache.getAccount().getId())) {
             holder.priority.setTag(R.id.flag_trade_id, bean.getId());

+ 2 - 2
app/src/com/sheishuo/app/core_module/trade/view/ui/activity/PayMethodActivity.java

@@ -78,7 +78,7 @@ public class PayMethodActivity extends SheishuoUI implements PaymentListener{
                     }
 
                     @Override
-                    public void onFailed() {
+                    public void onFailed(String error) {
                         showToast(context,"创建订单失败");
                     }
                 });
@@ -98,7 +98,7 @@ public class PayMethodActivity extends SheishuoUI implements PaymentListener{
     public void onPaymentFinish(Boolean isSuccess) {
         if (isSuccess){
             showToast(context,"充值成功");
-            int originMoney = Integer.parseInt(AccountCache.getAccount().getCoin());
+            double originMoney = Double.parseDouble(AccountCache.getAccount().getCoin());
             String nowMoney = String.valueOf(originMoney + money);
             AccountCache.getAccount().setCoin(nowMoney);
             finish();

+ 16 - 0
app/src/com/sheishuo/app/core_module/trade/view/ui/activity/RechargeActivity.java

@@ -4,13 +4,16 @@ import android.content.Context;
 import android.content.Intent;
 import android.os.Bundle;
 import android.support.annotation.IdRes;
+import android.util.Log;
 import android.view.View;
+import android.view.ViewGroup;
 import android.widget.Button;
 import android.widget.GridLayout;
 import android.widget.GridView;
 import android.widget.LinearLayout;
 import android.widget.RadioButton;
 
+import com.netease.nim.uikit.common.util.sys.ScreenUtil;
 import com.netease.nim.uikit.views.MutipleRadioGroup;
 import com.sheishuo.app.R;
 import com.sheishuo.app.common.views.BaseToolbar;
@@ -74,6 +77,19 @@ public class RechargeActivity extends SheishuoUI {
                 finish();
             }
         });
+
+
+        int screenWidth = ScreenUtil.px2dip(ScreenUtil.screenWidth);
+        int itemWidth = (screenWidth - 15 * 2 - 10 * 2) / 3;
+        Log.e("grid width", ""+itemWidth+"/"+screenWidth);
+        for(int i=0; i<itemGrid.getChildCount(); i++)
+        {
+            View view = itemGrid.getChildAt(i);
+            ViewGroup.LayoutParams layoutParams = view.getLayoutParams();
+            layoutParams.width = ScreenUtil.dip2px(itemWidth);
+            view.setLayoutParams(layoutParams);
+        }
+
     }
 
     void initRechargeItems()

+ 17 - 9
app/src/com/sheishuo/app/core_module/trade/view/ui/activity/TradeChangePriorityActivity.java

@@ -6,6 +6,7 @@ import android.view.View;
 import android.widget.SeekBar;
 import android.widget.TextView;
 
+import com.netease.nim.uikit.UIKitCache;
 import com.sheishuo.app.R;
 import com.sheishuo.app.common.views.BaseToolbar;
 import com.sheishuo.app.core_module.trade.view.adapter.TradeItemAdapter;
@@ -85,18 +86,15 @@ public class TradeChangePriorityActivity extends SheishuoUI {
                 break;
         }
 
-
-        priorityNumTv.setText("x"+ priority + "  " + type);
-
-
-
         seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
             @Override
             public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
-                if (progress < 1) seekBar.setProgress(1);
-                nowPriority = String.valueOf(Integer.valueOf(priority) + progress);
-                priorityNumTv.setText("x"+ nowPriority + "(+" + progress +  ")   " + type);
-
+                if (progress < 1)
+                {
+                    seekBar.setProgress(1);
+                    progress = 1;
+                }
+                UpdatePriorityProgress(progress);
             }
 
             @Override
@@ -110,9 +108,19 @@ public class TradeChangePriorityActivity extends SheishuoUI {
             }
         });
 
+        UpdatePriorityProgress(1);
     }
 
+    private void UpdatePriorityProgress(int progress)
+    {
+        nowPriority = String.valueOf(Integer.valueOf(priority) + progress);
+        priorityNumTv.setText("x"+ nowPriority + "(+" + progress +  ")   " + type);
 
+        int index = 3-Integer.parseInt(priorityType);
+        String price = UIKitCache.getAccount().getTrade_priority().get(index).getSumPrice(progress);
+        String tip = "置顶x"+nowPriority+"(+"+progress+")  共"+price+"说币";
+        priorityNumTv.setText(tip);
+    }
 
 
 }

+ 2 - 2
app/src/com/sheishuo/app/core_module/trade/view/ui/activity/TradeDetailsActivity.java

@@ -127,7 +127,7 @@ public class TradeDetailsActivity extends SheishuoUI {
         locationTV.setText(bean.getDistrict());
         dateTV.setText(bean.getInputtime());
         if (bean.getPriority().equals("0")) priorityTV.setVisibility(View.INVISIBLE);
-        priorityTV.setText("置顶x" + bean.getPrice());
+        priorityTV.setText(bean.getLocal()+"x" + bean.getPriority());
         priorityTV.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
@@ -197,6 +197,6 @@ public class TradeDetailsActivity extends SheishuoUI {
     public void onPriorityUpdate(String tradeId, String priority)
     {
         bean.setPriority(priority);
-        priorityTV.setText("置顶x" + bean.getPrice());
+        priorityTV.setText("置顶x" + bean.getPriority());
     }
 }

+ 57 - 16
app/src/com/sheishuo/app/core_module/trade/view/ui/activity/TradePublishActivity.java

@@ -26,12 +26,14 @@ import android.widget.Spinner;
 import android.widget.TextView;
 
 import com.bumptech.glide.Glide;
+import com.netease.nim.uikit.UIKitCache;
 import com.netease.nim.uikit.activity.GiftRechargeActivity;
 import com.netease.nim.uikit.common.media.picker.PickImageHelper;
 import com.netease.nim.uikit.common.media.picker.model.PhotoInfo;
 import com.netease.nim.uikit.common.ui.dialog.DialogMaker;
 import com.netease.nim.uikit.common.ui.dialog.EasyAlertDialog;
 import com.netease.nim.uikit.common.ui.dialog.EasyAlertDialogHelper;
+import com.netease.nim.uikit.session.activity.WatchPictureActivity;
 import com.netease.nim.uikit.session.constant.Extras;
 import com.sheishuo.app.R;
 import com.sheishuo.app.cache.AccountCache;
@@ -78,7 +80,7 @@ public class TradePublishActivity extends SheishuoUI {
 
     private SeekBar prioritySeekbar;
 
-    private TextView priorityTV,emptyTipTV,balanceTV,rechargeTV;
+    private TextView priorityTipTV,priorityTV,emptyTipTV,balanceTV,rechargeTV;
 
     private LinearLayout photosLayout,tradeLayout,parentLayout;
 
@@ -97,7 +99,7 @@ public class TradePublishActivity extends SheishuoUI {
 
     //FLAGS
     private String teamId = "";
-    private String PRIORITY_TYPE = TradeItemAdapter.PRIORITY_COUNTRY;
+    private String PRIORITY_TYPE = TradeItemAdapter.PRIORITY_DISTRICT;
     private int TRADE_TYPE = TradeModel.TYPE_SELL;
     private int RADIO_CHECKED;
 
@@ -125,7 +127,8 @@ public class TradePublishActivity extends SheishuoUI {
         buyRadioBtn = findView(R.id.gift_panel_buy_radio_btn);
         spinner = findView(R.id.gift_panel_spinner);
         prioritySeekbar = findView(R.id.gift_panel_num_seekbar);
-        priorityTV = findView(R.id.gift_panel_num_TV);
+        priorityTipTV = findView(R.id.gift_priority_tip);
+        //priorityTV = findView(R.id.gift_panel_num_TV);
         photosLayout = findView(R.id.gift_panel_photos_layout);
         balanceTV = findView(R.id.gift_panel_balance_TV);
         rechargeTV = findView(R.id.gift_panel_recharge_TV);
@@ -145,7 +148,7 @@ public class TradePublishActivity extends SheishuoUI {
         });
 
         //初始化余额
-        balanceTV.setText(AccountCache.getAccount().getCoin());
+        balanceTV.setText(AccountCache.getAccount().getCoinStr());
 
         //初始化充值
         rechargeTV.setOnClickListener(new View.OnClickListener() {
@@ -156,17 +159,18 @@ public class TradePublishActivity extends SheishuoUI {
             }
         });
         //设置Spinner
-        List<LoginBean.DBean.TradePriorityBean> priorityBeanList = AccountCache.getAccount().getTrade_priority();
-        for(LoginBean.DBean.TradePriorityBean bean : priorityBeanList)
+        List<UIKitCache.AccountBean.TradePriorityBean> priorityBeanList = UIKitCache.getAccount().getTrade_priority();
+        for(UIKitCache.AccountBean.TradePriorityBean bean : priorityBeanList)
         {
-            priorityTypeList.add(bean.getName()+" "+bean.getPrice());
+            priorityTypeList.add(bean.getName());
         }
         adapter = new ArrayAdapter<>(context, android.R.layout.simple_spinner_dropdown_item, priorityTypeList);
         spinner.setAdapter(adapter);
         spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
             @Override
             public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
-                PRIORITY_TYPE = String.valueOf(position);
+                PRIORITY_TYPE = String.valueOf(3-position);
+                UpdatePriorityProgress(prioritySeekbar.getProgress());
             }
 
             @Override
@@ -180,7 +184,11 @@ public class TradePublishActivity extends SheishuoUI {
         prioritySeekbar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
             @Override
             public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
-                    priorityTV.setText(String.valueOf(progress));
+                if(progress == 0) {
+                    seekBar.setProgress(1);
+                    progress = 1;
+                }
+                UpdatePriorityProgress(progress);
             }
 
             @Override
@@ -264,6 +272,15 @@ public class TradePublishActivity extends SheishuoUI {
         });
         photosLayout.addView(addImg);
 
+        UpdatePriorityProgress(1);
+    }
+
+    private void UpdatePriorityProgress(int progress)
+    {
+        int index = 3-Integer.parseInt(PRIORITY_TYPE);
+        String price = UIKitCache.getAccount().getTrade_priority().get(index).getSumPrice(progress);
+        String tip = "置顶x"+progress+"  共"+price+"说币";
+        priorityTipTV.setText(tip);
     }
 
 
@@ -292,7 +309,7 @@ public class TradePublishActivity extends SheishuoUI {
     }
 
 
-    private ImageView createImageView(String filePath)
+    private ImageView createImageView(final String filePath)
     {
         selectedPhotoPathList.add(filePath);
 
@@ -329,6 +346,12 @@ public class TradePublishActivity extends SheishuoUI {
                 return false;
             }
         });
+        imageView.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                WatchPictureActivity.start(context, selectedPhotoPathList, selectedPhotoPathList, selectedPhotoPathList.indexOf(filePath));
+            }
+        });
 
         Glide.with(context).load(filePath)
                 .into(imageView);
@@ -358,6 +381,14 @@ public class TradePublishActivity extends SheishuoUI {
             return;
         }
 
+        int priority = prioritySeekbar.getProgress();
+        if(priority <= 0)
+        {
+            EasyAlertDialogHelper.showOneButtonDiolag(TradePublishActivity.this, "提示",
+                    "置顶数量需要大于0", "确认", false, null);
+            return;
+        }
+
         DialogMaker.showProgressDialog(TradePublishActivity.this, "");
 
         photoIds.clear();
@@ -374,24 +405,34 @@ public class TradePublishActivity extends SheishuoUI {
             }
         }
 
-        Log.e(TAG,photosStr);
+        Log.e(TAG, photosStr);
 
         new NetImpl().publishTrade(TRADE_TYPE
                 , tradeContentET.getText().toString()
                 , photosStr
-                , Integer.valueOf(priorityTV.getText().toString())
+                , prioritySeekbar.getProgress()
                 , Integer.valueOf(PRIORITY_TYPE)
                 , teamId
                 , new ResponseCallback() {
                     @Override
                     public void onSuccess(Object object) {
                         try {
-                            int code = new JSONObject((String) object).getInt("c");
-                            if (1 == code){
-                                showToast(context,new JSONObject((String) object).getString("d"));
+                            JSONObject jsonObject = new JSONObject((String) object);
+                            int code = jsonObject.getInt("c");
+                            if (code > 0){
+                                showToast(context, jsonObject.getString("d"));
                             }else {
+                                double coin = jsonObject.getJSONObject("d").getDouble("coin");
+                                int tradeId = jsonObject.getJSONObject("d").getInt("id");
+                                AccountCache.getAccount().setCoin(""+coin);
+                                if(TextUtils.isEmpty(teamId))
+                                {
+                                    AccountCache.lastPulishedTradeId = tradeId;
+                                }
                                 showToast(context,"发布成功");
                             }
+
+
                             DialogMaker.dismissProgressDialog();
                             finish();
 
@@ -401,7 +442,7 @@ public class TradePublishActivity extends SheishuoUI {
                     }
 
                     @Override
-                    public void onFailed() {
+                    public void onFailed(String error) {
                         DialogMaker.dismissProgressDialog();
                         showToast(context,"发布失败");
                     }

+ 35 - 13
app/src/com/sheishuo/app/core_module/trade/view/ui/activity/TradeSearchActivity.java

@@ -2,16 +2,22 @@ package com.sheishuo.app.core_module.trade.view.ui.activity;
 
 import android.content.Context;
 import android.content.Intent;
+import android.nfc.Tag;
 import android.os.Bundle;
+import android.text.Editable;
+import android.text.TextWatcher;
+import android.text.method.KeyListener;
 import android.util.Log;
 import android.view.KeyEvent;
 import android.view.View;
+import android.view.inputmethod.InputMethodManager;
 import android.widget.EditText;
 import android.widget.LinearLayout;
 import android.widget.TextView;
 
 import com.huawei.hms.support.api.pay.PayResultInfo;
 import com.sheishuo.app.R;
+import com.sheishuo.app.SheishuoApplication;
 import com.sheishuo.app.common.beans.TradeBean;
 import com.sheishuo.app.common.util.net.INet;
 import com.sheishuo.app.common.util.net.NetImpl;
@@ -61,19 +67,35 @@ public class TradeSearchActivity extends SheishuoUI {
         searchTV.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
-                searchTrade();
+                finish();
 
             }
         });
-
-
-
         parentLayout.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
                 finish();
             }
         });
+        getHandler().postDelayed(new Runnable() {
+            @Override
+            public void run() {
+                searchET.requestFocus();
+                InputMethodManager imm = (InputMethodManager) SheishuoApplication.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
+                imm.showSoftInput(searchET, 0);
+            }
+        }, 100);
+
+        searchET.setOnKeyListener(new View.OnKeyListener() {
+            @Override
+            public boolean onKey(View v, int keyCode, KeyEvent event) {
+                if (keyCode == KeyEvent.KEYCODE_ENTER){
+                    searchTrade();
+                    return true;
+                }
+                return false;
+            }
+        });
     }
 
 
@@ -87,13 +109,13 @@ public class TradeSearchActivity extends SheishuoUI {
     }
 
 
-    @Override
-    public boolean onKeyDown(int keyCode, KeyEvent event) {
-        Log.e(TAG,"KeyDown");
-        if (event.getAction() == KeyEvent.KEYCODE_ENTER){
-            searchTrade();
-            return true;
-        }
-        return false;
-    }
+//    @Override
+//    public boolean onKeyDown(int keyCode, KeyEvent event) {
+//        Log.e(TAG,"KeyDown");
+//        if (event.getAction() == KeyEvent.KEYCODE_ENTER){
+//            searchTrade();
+//            return true;
+//        }
+//        return false;
+//    }
 }

+ 2 - 2
app/src/com/sheishuo/app/impl/SheishuoTeamMessageActivity.java

@@ -269,7 +269,7 @@ public class SheishuoTeamMessageActivity extends TeamMessageActivity {
                     }
 
                     @Override
-                    public void onFailed() {
+                    public void onFailed(String error) {
 
                     }
                 });
@@ -443,7 +443,7 @@ public class SheishuoTeamMessageActivity extends TeamMessageActivity {
     }
 
 
-    public boolean isSystemTeam(Team team){
+    public static boolean isSystemTeam(Team team){
         if (Integer.parseInt(team.getCreator()) < 20000)
         {
             return true;

+ 206 - 8
app/src/com/sheishuo/app/login/LoginActivity.java

@@ -2,17 +2,28 @@ package com.sheishuo.app.login;
 
 import android.content.Context;
 import android.content.Intent;
+import android.content.SharedPreferences;
+import android.graphics.Color;
+import android.os.Build;
 import android.os.Bundle;
 import android.os.Handler;
 import android.os.IBinder;
+import android.support.v4.view.PagerAdapter;
+import android.support.v4.view.ViewCompat;
+import android.support.v4.view.ViewPager;
 import android.util.Log;
 import android.view.MotionEvent;
 import android.view.View;
+import android.view.ViewGroup;
+import android.view.Window;
+import android.view.WindowManager;
 import android.view.inputmethod.InputMethodManager;
 import android.widget.Button;
 import android.widget.CompoundButton;
 import android.widget.EditText;
+import android.widget.ImageView;
 import android.widget.RadioButton;
+import android.widget.RelativeLayout;
 import android.widget.TextView;
 import android.widget.Toast;
 
@@ -41,18 +52,26 @@ import com.sheishuo.app.main.activity.ForgetActivity;
 
 public class LoginActivity extends SheishuoUI implements View.OnClickListener{
 
+    public final static String SHARED_PREFERENCES_KEY = "SP";
+    public final static String SHOW_INTRO_KEY = "ShowIntro";
+
     private String TAG = this.getClass().getSimpleName();
     private Context context = this;
     private Handler handler = new Handler();
 
     private EditText telET,pwdET;
-    private Button loginBtn;
+    private Button loginBtn,skipBtn,startBtn;
     private TextView toRegisterTxt;
     private TextView toAgreeTxt;
     private TextView forgetTxt;
     private RadioButton agreeRadio;
     private boolean isAgree = true;
 
+    RelativeLayout introLayout;
+    private ViewPager imageViewPager;
+    private PagerAdapter adapter;
+    private int introPages = 3;
+
     private INet net = new NetImpl();
 
     public static void start(Context context) {
@@ -61,19 +80,50 @@ public class LoginActivity extends SheishuoUI implements View.OnClickListener{
         context.startActivity(intent);
     }
 
+    @Override
+    protected void onResume() {
+        super.onResume();
 
+        if(Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP)
+            return;
 
+        Window window = this.getWindow();
+        //添加Flag把状态栏设为可绘制模式
+        window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
+        if (true) {
+            //如果为全透明模式,取消设置Window半透明的Flag
+            window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
+            //设置状态栏为透明
+            window.setStatusBarColor(Color.TRANSPARENT);
+            //设置window的状态栏不可见
+            window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
+        } else {
+            //如果为半透明模式,添加设置Window半透明的Flag
+            window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
+            //设置系统状态栏处于可见状态
+            window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE);
+        }
+        //view不根据系统窗口来调整自己的布局
+        ViewGroup mContentView = (ViewGroup) window.findViewById(Window.ID_ANDROID_CONTENT);
+        View mChildView = mContentView.getChildAt(0);
+        if (mChildView != null) {
+            ViewCompat.setFitsSystemWindows(mChildView, false);
+            ViewCompat.requestApplyInsets(mChildView);
+        }
+    }
+
+    @Override
+    protected void onPause() {
+        super.onPause();
+
+        if(Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP)
+            return;
+    }
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.login_and_reg_login_layout);
-        SheishuoToolbarOptions options = new SheishuoToolbarOptions();
-        options.titleString = "登录";
-        options.isNeedNavigate = true;
-        options.navigateId = R.drawable.actionbar_dark_back_icon;
-        options.backgroundColor = R.color.white;
-        setToolBar(R.id.toolbar, options);
         init();
     }
 
@@ -103,9 +153,25 @@ public class LoginActivity extends SheishuoUI implements View.OnClickListener{
             case R.id.forgot_password:
                 startActivity(new Intent(context, ForgetActivity.class));
                 break;
+            case R.id.skip_btn:
+            case R.id.start_btn:
+                closeIntro();
+                break;
         }
     }
 
+    private void closeIntro()
+    {
+
+        SharedPreferences sp = context.getSharedPreferences(SHARED_PREFERENCES_KEY, MODE_PRIVATE);
+        //存入数据
+        SharedPreferences.Editor editor = sp.edit();
+        editor.putBoolean(SHOW_INTRO_KEY, true);
+        editor.commit();
+
+        introLayout.setVisibility(View.GONE);
+    }
+
 
     protected void init(){
         telET = findView(R.id.login_tel);
@@ -115,14 +181,146 @@ public class LoginActivity extends SheishuoUI implements View.OnClickListener{
         toAgreeTxt = findView(R.id.agree_txt);
         agreeRadio = findView(R.id.agree_radio);
         forgetTxt = findView(R.id.forgot_password);
+        skipBtn = findView(R.id.skip_btn);
+        startBtn = findView(R.id.start_btn);
 
         loginBtn.setOnClickListener(this);
         toRegisterTxt.setOnClickListener(this);
         toAgreeTxt.setOnClickListener(this);
         agreeRadio.setOnClickListener(this);
         forgetTxt.setOnClickListener(this);
+        skipBtn.setOnClickListener(this);
+        startBtn.setOnClickListener(this);
+
+        introLayout = findView(R.id.intro_layout);
+        imageViewPager = findView(R.id.view_pager);
+
+        final String mobile = (String) SPHelper.getParam(context,"mobile","");
+        final String pwd = (String) SPHelper.getParam(context,"pwd","");
+        if (!(mobile.isEmpty() || pwd.isEmpty())){
+            DialogMaker.showProgressDialog(this, "登录中...");
+            new NetImpl().loginQuery(mobile, pwd, new ResponseCallback() {
+                @Override
+                public void onSuccess(Object object) {
+                    LoginBean bean = (LoginBean)object;
+                    //存入SP用于自动登录
+                    SPHelper.setParam(context,"mobile",mobile);
+                    SPHelper.setParam(context,"pwd",pwd);
+
+
+                    //将用户信息放入缓存
+                    AccountCache.setCache(bean.getD());
+                    AccountCache.sync();
+
+
+
+                    //登录NIM服务
+                    new LoginHelper(LoginActivity.this,bean).loginToNIM();
+
+
+                }
+
+                @Override
+                public void onFailed(String error) {
+                    getHandler().post(new Runnable() {
+                        @Override
+                        public void run() {
+                            Toast.makeText(context,"登录失败",Toast.LENGTH_SHORT).show();
+                            loginBtn.setEnabled(true);
+                            loginBtn.setText("登录");
+                            DialogMaker.dismissProgressDialog();
+                        }
+                    });
+                }
+            });
+        }
+
+
+        initIntroView();
+    }
+
+    private void initIntroView()
+    {
+        SharedPreferences sp = context.getSharedPreferences(SHARED_PREFERENCES_KEY, MODE_PRIVATE);
+        //存入数据
+        if(sp.getBoolean(SHOW_INTRO_KEY, false))
+        {
+            introLayout.setVisibility(View.GONE);
+            return;
+        }
+
+        adapter = new PagerAdapter() {
+            @Override
+            public int getCount() {
+                return introPages;
+            }
+
+            @Override
+            public boolean isViewFromObject(View view, Object object) {
+                return (view == object);
+            }
+
+            @Override
+            public Object instantiateItem(ViewGroup container, int position) {
+
+                ImageView imageView = new ImageView(context);
+                imageView.setScaleType(ImageView.ScaleType.FIT_CENTER);
+                imageView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
+                if(position == 0)
+                    imageView.setImageResource(R.drawable.tuto_1_min);
+                else if(position == 1)
+                    imageView.setImageResource(R.drawable.tuto_2_min);
+                else if(position == 2)
+                    imageView.setImageResource(R.drawable.tuto_3_min);
+
+                container.addView(imageView);
+
+                if (position == 0) {
+                    onViewPagerSelected(position);
+                }
+
+                return imageView;
+            }
+
+            @Override
+            public int getItemPosition(Object object) {
+                return POSITION_NONE;
+            }
+        };
+
+        imageViewPager.setAdapter(adapter);
+        imageViewPager.setOffscreenPageLimit(9);
+        imageViewPager.setCurrentItem(0);
+        imageViewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
+            @Override
+            public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
+            }
+
+            @Override
+            public void onPageSelected(int position) {
+                onViewPagerSelected(position);
+            }
+
+            @Override
+            public void onPageScrollStateChanged(int state) {
+            }
+        });
     }
 
+    private void onViewPagerSelected(int position) {
+        if(position == introPages-1)
+        {
+            startBtn.setVisibility(View.VISIBLE);
+            skipBtn.setVisibility(View.GONE);
+        }
+        else
+        {
+            startBtn.setVisibility(View.GONE);
+            skipBtn.setVisibility(View.VISIBLE);
+        }
+    }
+
+
 
 
     protected <T extends View> T findView(int id){
@@ -178,7 +376,7 @@ public class LoginActivity extends SheishuoUI implements View.OnClickListener{
             }
 
             @Override
-            public void onFailed() {
+            public void onFailed(String error) {
                 handler.post(new Runnable() {
                     @Override
                     public void run() {

+ 1 - 42
app/src/com/sheishuo/app/login/LoginAndRegActivity.java

@@ -108,48 +108,7 @@ public class LoginAndRegActivity extends SheishuoUI implements View.OnClickListe
         introLayout = findView(R.id.intro_layout);
         imageViewPager = findView(R.id.view_pager);
 
-        final String mobile = (String) SPHelper.getParam(context,"mobile","");
-        final String pwd = (String) SPHelper.getParam(context,"pwd","");
-        if (!(mobile.isEmpty() || pwd.isEmpty())){
-            DialogMaker.showProgressDialog(this, "登录中...");
-            new NetImpl().loginQuery(mobile, pwd, new ResponseCallback() {
-                @Override
-                public void onSuccess(Object object) {
-                    LoginBean bean = (LoginBean)object;
-                    //存入SP用于自动登录
-                    SPHelper.setParam(context,"mobile",mobile);
-                    SPHelper.setParam(context,"pwd",pwd);
 
-
-                    //将用户信息放入缓存
-                    AccountCache.setCache(bean.getD());
-                    AccountCache.sync();
-
-
-
-                    //登录NIM服务
-                    new LoginHelper(LoginAndRegActivity.this,bean).loginToNIM();
-
-
-                }
-
-                @Override
-                public void onFailed() {
-                    getHandler().post(new Runnable() {
-                        @Override
-                        public void run() {
-                            Toast.makeText(context,"登录失败",Toast.LENGTH_SHORT).show();
-                            loginBtn.setEnabled(true);
-                            loginBtn.setText("登录");
-                            DialogMaker.dismissProgressDialog();
-                        }
-                    });
-                }
-            });
-        }
-
-
-        initIntroView();
     }
 
     private void initIntroView()
@@ -277,7 +236,7 @@ public class LoginAndRegActivity extends SheishuoUI implements View.OnClickListe
 
     @OnMPermissionGranted(BASIC_PERMISSION_REQUEST_CODE)
     public void onBasicPermissionSuccess() {
-        Toast.makeText(this, "授权成功", Toast.LENGTH_SHORT).show();
+        //Toast.makeText(this, "授权成功", Toast.LENGTH_SHORT).show();
         MPermission.printMPermissionResult(false, this, BASIC_PERMISSIONS);
     }
 

+ 11 - 9
app/src/com/sheishuo/app/login/RegisterActivity.java

@@ -78,16 +78,18 @@ public class RegisterActivity extends SheishuoUI implements View.OnClickListener
         registerBtn = $(R.id.register_btn);
         agreeTxt = $(R.id.agree_txt);
         agreeRadioBtn = $(R.id.agree_radio);
+        toolbar = $(R.id.toolbar);
     }
 
     private void init() {
 
-        SheishuoToolbarOptions options = new SheishuoToolbarOptions();
-        options.titleString = "注册";
-        options.isNeedNavigate = true;
-        options.navigateId = R.drawable.actionbar_dark_back_icon;
-        options.backgroundColor = R.color.white;
-        setToolBar(R.id.toolbar, options);
+        toolbar.setTitle("注册");
+        toolbar.setBackOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                finish();
+            }
+        });
 
         getCodeTV.setOnClickListener(this);
         registerBtn.setOnClickListener(this);
@@ -189,7 +191,7 @@ public class RegisterActivity extends SheishuoUI implements View.OnClickListener
                     }
 
                     @Override
-                    public void onFailed() {
+                    public void onFailed(String error) {
 
                     }
                 });
@@ -281,12 +283,12 @@ public class RegisterActivity extends SheishuoUI implements View.OnClickListener
 
                     } catch (Exception e) {
                         e.printStackTrace();
-                        this.onFailed();
+                        this.onFailed(null);
                     }
                 }
 
                 @Override
-                public void onFailed() {
+                public void onFailed(String error) {
                     registerFailed(null);
                 }
             });

+ 8 - 0
app/src/com/sheishuo/app/login/beans/LoginBean.java

@@ -1,5 +1,6 @@
 package com.sheishuo.app.login.beans;
 
+import java.text.DecimalFormat;
 import java.util.List;
 
 /**
@@ -98,6 +99,13 @@ public class LoginBean {
             this.coin = coin;
         }
 
+        public String getCoinStr()
+        {
+            DecimalFormat df = new DecimalFormat("###.##");
+            double d = Double.parseDouble(coin);
+            return df.format(d);
+        }
+
         public String getLatitude() {
             return latitude;
         }

+ 11 - 6
app/src/com/sheishuo/app/main/activity/ForgetActivity.java

@@ -121,7 +121,7 @@ public class ForgetActivity extends SheishuoUI {
             }
 
             @Override
-            public void onFailed() {
+            public void onFailed(String error) {
 
             }
         });
@@ -154,7 +154,7 @@ public class ForgetActivity extends SheishuoUI {
             }
 
             @Override
-            public void onFailed() {
+            public void onFailed(String error) {
                 DialogMaker.dismissProgressDialog();
                 showToast("密码重置失败");
             }
@@ -163,10 +163,15 @@ public class ForgetActivity extends SheishuoUI {
 
     private void reset()
     {
-        mobileTxt.setText("");
-        codeTxt.setText("");
-        pwdTxt.setText("");
-        confirmTxt.setText("");
+        getHandler().post(new Runnable() {
+            @Override
+            public void run() {
+                mobileTxt.setText("");
+                codeTxt.setText("");
+                pwdTxt.setText("");
+                confirmTxt.setText("");
+            }
+        });
     }
 
     private void showToast(final String content)

+ 1 - 1
app/src/com/sheishuo/app/main/activity/MainActivity.java

@@ -181,7 +181,7 @@ public class MainActivity extends SheishuoUI {
 
     @OnMPermissionGranted(BASIC_PERMISSION_REQUEST_CODE)
     public void onBasicPermissionSuccess() {
-        Toast.makeText(this, "授权成功", Toast.LENGTH_SHORT).show();
+        //Toast.makeText(this, "授权成功", Toast.LENGTH_SHORT).show();
         MPermission.printMPermissionResult(false, this, BASIC_PERMISSIONS);
     }
 

+ 2 - 2
app/src/com/sheishuo/app/main/activity/SystemMessageActivity.java

@@ -466,7 +466,7 @@ public class SystemMessageActivity extends UI implements TAdapterDelegate,
                 }
 
                 @Override
-                public void onFailed() {
+                public void onFailed(String error) {
                     getHandler().post(new Runnable() {
                         @Override
                         public void run() {
@@ -619,7 +619,7 @@ public class SystemMessageActivity extends UI implements TAdapterDelegate,
             }
 
             @Override
-            public void onFailed() {
+            public void onFailed(String error) {
 
             }
         });

+ 3 - 2
app/src/com/sheishuo/app/main/activity/WelcomeActivity.java

@@ -12,6 +12,7 @@ import com.sheishuo.app.R;
 import com.sheishuo.app.avchat.activity.AVChatActivity;
 import com.sheishuo.app.common.util.sys.SysInfoUtil;
 import com.sheishuo.app.config.preference.Preferences;
+import com.sheishuo.app.login.LoginActivity;
 import com.sheishuo.app.login.LoginAndRegActivity;
 import com.sheishuo.app.main.model.Extras;
 import com.netease.nim.uikit.common.activity.UI;
@@ -65,7 +66,7 @@ public class WelcomeActivity extends UI {
                         onIntent();
                     } else {
                         Log.e(TAG,"LoginAndRegister");
-                        LoginAndRegActivity.start(context);
+                        LoginActivity.start(context);
                         finish();
                     }
                 }
@@ -116,7 +117,7 @@ public class WelcomeActivity extends UI {
         if (TextUtils.isEmpty(SheishuoCache.getAccount())) {
             // 判断当前app是否正在运行
             if (!SysInfoUtil.stackResumed(this)) {
-                LoginAndRegActivity.start(this);
+                LoginActivity.start(context);
             }
             finish();
         } else {

+ 1 - 1
app/src/com/sheishuo/app/main/adapter/AreaGroupsAdapter.java

@@ -53,7 +53,7 @@ public class AreaGroupsAdapter extends RecyclerView.Adapter<AreaGroupsAdapter.Ar
                 holder.groupName.setText(team.getName());
                 holder.groupMemberNum.setText(team.getMemberCount() + "人热聊中");
 
-                if (team.getName().equals("国家聊天室")) {
+                if (team.getName().contains("国家")) {
                     Glide.with(context).load(R.drawable.group_country).into(holder.groupIco);
                 } else if (team.getName().contains("市") || team.getName().contains("省")) {
                     Glide.with(context).load(R.drawable.group_province_city)

+ 1 - 4
app/src/com/sheishuo/app/main/adapter/CircleListAdapter.java

@@ -96,7 +96,6 @@ public class CircleListAdapter  extends RecyclerView.Adapter<CircleListAdapter.C
         holder.layout.setOnClickListener(this);
         holder.contentTV.setText(bean.getMsg());
         holder.contentTV.setVisibility(bean.getMsg().length() > 0 ? View.VISIBLE : View.GONE);
-        holder.locationTV.setText(bean.getLocal());
         holder.dateTV.setText(bean.getInputtime());
         holder.likesNumTV.setText(""+bean.getLikes());
         holder.visitNumTv.setText(""+bean.getViews());
@@ -274,7 +273,7 @@ public class CircleListAdapter  extends RecyclerView.Adapter<CircleListAdapter.C
                             }
 
                             @Override
-                            public void onFailed() {
+                            public void onFailed(String error) {
                                 if(circleFragment != null)
                                     circleFragment.showToast("删除失败");
                                 if(circleActivity != null)
@@ -458,7 +457,6 @@ public class CircleListAdapter  extends RecyclerView.Adapter<CircleListAdapter.C
         private LinearLayout commentsLayout, avatarContainer;
         private TextView usernameTV
                 ,contentTV
-                ,locationTV
                 ,dateTV
                 ,visitNumTv
                 ,deleteTV
@@ -482,7 +480,6 @@ public class CircleListAdapter  extends RecyclerView.Adapter<CircleListAdapter.C
             gridView = (ImgGridView) v.findViewById(R.id.gridview_imgs);
             usernameTV = (TextView) v.findViewById(R.id.username_tv);
             contentTV = (TextView) v.findViewById(R.id.user_content_tv);
-            locationTV = (TextView) v.findViewById(R.id.location_tv);
             dateTV = (TextView) v.findViewById(R.id.date_tv);
             visitNumTv = (TextView) v.findViewById(visit_num_tv);
             deleteTV = (TextView) v.findViewById(R.id.delete_tv);

+ 12 - 10
app/src/com/sheishuo/app/main/fragment/AreaGroupsFragment.java

@@ -101,7 +101,7 @@ public class AreaGroupsFragment extends MainTabFragment implements NimLocationMa
         initToolbar();
         loadGiftCache();
 
-        setLocationTxt(AccountCache.getAccount().getCity() + AccountCache.getAccount().getDistrict());
+        setLocationTxt(AccountCache.getAccount().getDistrict());
 
         moreAreaGroupsTV.setOnClickListener(new View.OnClickListener() {
             @Override
@@ -157,7 +157,7 @@ public class AreaGroupsFragment extends MainTabFragment implements NimLocationMa
                 showLocationSelect();
             }
         });
-
+        setLocationTxt(location);
         toolbar.setLeftItems(new View[]{leftIcon, toolbarLeftTxt});
 
 
@@ -234,14 +234,13 @@ public class AreaGroupsFragment extends MainTabFragment implements NimLocationMa
                     @Override
                     public void run() {
                         loadGroups();
-                        setLocationTxt(AccountCache.getAccount().getCity()
-                                + AccountCache.getAccount().getDistrict());
+                        setLocationTxt(AccountCache.getAccount().getDistrict());
                     }
                 });
             }
 
             @Override
-            public void onFailed() {
+            public void onFailed(String error) {
                 showToast("更新地理位置失败,请检查定位权限");
             }
         });
@@ -332,7 +331,7 @@ public class AreaGroupsFragment extends MainTabFragment implements NimLocationMa
 //                    }
 //
 //                    @Override
-//                    public void onFailed() {
+//                    public void onFailed(String error) {
 //
 //                    }
 //                });
@@ -396,7 +395,7 @@ public class AreaGroupsFragment extends MainTabFragment implements NimLocationMa
             }
 
             @Override
-            public void onFailed() {
+            public void onFailed(String error) {
                 showToast("礼物列表加载失败");
             }
         });
@@ -456,7 +455,7 @@ public class AreaGroupsFragment extends MainTabFragment implements NimLocationMa
             }
 
             @Override
-            public void onFailed() {
+            public void onFailed(String error) {
 
             }
         });
@@ -488,7 +487,7 @@ public class AreaGroupsFragment extends MainTabFragment implements NimLocationMa
 
 
             updateAccountLocation(province, city, area);
-            setLocationTxt(city + area);
+            setLocationTxt(area);
         }
     }
 
@@ -503,7 +502,7 @@ public class AreaGroupsFragment extends MainTabFragment implements NimLocationMa
                 String area = CityDataHelper.getAllDistrict().get(options1).get(options2).get(options3);
 
                 updateAccountLocation(province, city, area);
-                setLocationTxt(city+area);
+                setLocationTxt(area);
             }
         });
     }
@@ -511,6 +510,9 @@ public class AreaGroupsFragment extends MainTabFragment implements NimLocationMa
     private void setLocationTxt(String value)
     {
         location = value;
+        if(location == null)
+            return;
+
         if (location.length() > 6) {
             location = location.substring(0, 6) + "...";
         }

+ 58 - 29
app/src/com/sheishuo/app/main/fragment/CircleOfFriendsFragment.java

@@ -19,6 +19,7 @@ import android.widget.TextView;
 import android.widget.Toast;
 
 import com.bumptech.glide.Glide;
+import com.netease.nim.uikit.ContextCache;
 import com.netease.nim.uikit.common.media.picker.PickImageHelper;
 import com.netease.nim.uikit.common.media.picker.activity.PickImageActivity;
 import com.netease.nim.uikit.common.media.picker.model.PhotoInfo;
@@ -39,6 +40,7 @@ import com.sheishuo.app.common.util.net.NetStatus;
 import com.sheishuo.app.common.util.net.ResponseCallback;
 import com.sheishuo.app.common.views.ImgGridView;
 import com.sheishuo.app.core_module.circle.activity.CircleDetailsActivity;
+import com.sheishuo.app.core_module.circle.activity.CirclePersonActivity;
 import com.sheishuo.app.core_module.circle.activity.NewCommentActivity;
 import com.sheishuo.app.core_module.circle.activity.NewTweetingActivity;
 import com.sheishuo.app.common.beans.CircleBean;
@@ -104,26 +106,23 @@ public class CircleOfFriendsFragment extends MainTabFragment{
         presenter.loadCircleList(AccountCache.getAccount().getId(),"0", null);
 
         //初始化朋友圈首页界面
-        NimUserInfo user = NIMClient.getService(UserService.class).getUserInfo(AccountCache.getAccount().getId());
-        String avatarUrl = user.getAvatar();
-        try {
-            Glide.with(SheishuoApplication.getContext()).load(avatarUrl).into(avatar);
-            Glide.with(getActivity())
-                    .load(SocialInfoCache.get(AccountCache.getAccount().getId()).getSocial_banner())
-                    .centerCrop()
-                    .into(backgroundImg);
-            backgroundImg.setOnClickListener(new View.OnClickListener() {
-                @Override
-                public void onClick(View v) {
-                    pickImage(MineFragment.BANNER_SELECTED);
-                }
-            });
-        }catch (Exception e)
-        {
-            Log.e("Exception", e.getMessage());
-        }
+        avatar.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                //pickImage(MineFragment.BANNER_SELECTED);
+                UserInfoDetailActivity.start(getContext(), AccountCache.getAccount().getId());
+            }
+        });
 
-        username.setText(SocialInfoCache.getNick(user.getAccount()));
+        backgroundImg.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                pickImage(MineFragment.BANNER_SELECTED);
+                //UserInfoDetailActivity.start(getContext(), AccountCache.getAccount().getId());
+            }
+        });
+
+        fillTop();
         isLoaded = true;
 
     }
@@ -145,6 +144,8 @@ public class CircleOfFriendsFragment extends MainTabFragment{
     @Override
     public void onResume() {
         super.onResume();
+        fillTop();
+
 
         getHandler().post(new Runnable() {
             @Override
@@ -165,6 +166,25 @@ public class CircleOfFriendsFragment extends MainTabFragment{
         backgroundImg = (ImageView) getView().findViewById(R.id.circle_background);
     }
 
+    void fillTop(){
+        if(username == null || backgroundImg == null)
+            return;
+
+        NimUserInfo user = NIMClient.getService(UserService.class).getUserInfo(AccountCache.getAccount().getId());
+        String avatarUrl = user.getAvatar();
+        username.setText(SocialInfoCache.getNick(user.getAccount()));
+        try {
+            Glide.with(SheishuoApplication.getContext()).load(avatarUrl).into(avatar);
+            Glide.with(getActivity())
+                    .load(SocialInfoCache.get(AccountCache.getAccount().getId()).getSocial_banner())
+                    .centerCrop()
+                    .into(backgroundImg);
+        }catch (Exception e)
+        {
+            Log.e("Exception", e.getMessage());
+        }
+    }
+
     //初始化toolbar
     void initToolbar(){
         toolbar.setVisibility(View.VISIBLE);
@@ -355,9 +375,11 @@ public class CircleOfFriendsFragment extends MainTabFragment{
             //照相机
             String filePath = result.getString("file_path");
             if (requestCode == MineFragment.BANNER_SELECTED){
-                Glide.with(getActivity()).load(filePath)
-                        .centerCrop()
-                        .into(backgroundImg);
+                if(backgroundImg != null) {
+                    Glide.with(getActivity()).load(filePath)
+                            .centerCrop()
+                            .into(backgroundImg);
+                }
 
                 net.updateBanner(filePath, new ResponseCallback() {
                     @Override
@@ -366,7 +388,7 @@ public class CircleOfFriendsFragment extends MainTabFragment{
                     }
 
                     @Override
-                    public void onFailed() {
+                    public void onFailed(String error) {
                         showToast("更新背景图失败");
                     }
                 });
@@ -374,12 +396,19 @@ public class CircleOfFriendsFragment extends MainTabFragment{
             }
         } else {
             //相册
-            List<PhotoInfo> photoInfoList = (List<PhotoInfo>) result.getSerializable("photo_list");
+            final List<PhotoInfo> photoInfoList = (List<PhotoInfo>) result.getSerializable("photo_list");
             if (requestCode == MineFragment.BANNER_SELECTED){
-                Glide.with(getActivity())
-                        .load(photoInfoList.get(0).getFilePath())
-                        .centerCrop()
-                        .into(backgroundImg);
+                if(backgroundImg != null) {
+                    getHandler().post(new Runnable() {
+                        @Override
+                        public void run() {
+                            Glide.with(getActivity())
+                                    .load(photoInfoList.get(0).getAbsolutePath())
+                                    .centerCrop()
+                                    .into(backgroundImg);
+                        }
+                    });
+                }
                 net.updateBanner(photoInfoList.get(0).getAbsolutePath(), new ResponseCallback() {
                     @Override
                     public void onSuccess(Object object) {
@@ -387,7 +416,7 @@ public class CircleOfFriendsFragment extends MainTabFragment{
                     }
 
                     @Override
-                    public void onFailed() {
+                    public void onFailed(String error) {
                         showToast("更新背景图失败");
                     }
                 });

+ 105 - 5
app/src/com/sheishuo/app/main/fragment/HomeFragment.java

@@ -2,6 +2,7 @@ package com.sheishuo.app.main.fragment;
 
 import android.app.Activity;
 import android.content.Context;
+import android.content.DialogInterface;
 import android.content.Intent;
 import android.graphics.Color;
 import android.graphics.drawable.Drawable;
@@ -12,17 +13,23 @@ import android.support.v4.app.Fragment;
 import android.support.v4.view.ViewPager;
 import android.support.v4.view.ViewPager.OnPageChangeListener;
 import android.support.v7.widget.Toolbar;
+import android.text.TextUtils;
 import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.MenuItem;
 import android.view.View;
 import android.view.ViewGroup;
+import android.view.WindowManager;
 import android.widget.Button;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.TextView;
+import android.widget.Toast;
 
 import com.netease.nim.uikit.common.fragment.TFragment;
+import com.netease.nim.uikit.common.ui.dialog.EasyAlertDialog;
+import com.netease.nim.uikit.common.ui.dialog.EasyAlertDialogHelper;
+import com.netease.nim.uikit.common.ui.dialog.EasyEditDialog;
 import com.netease.nim.uikit.common.ui.drop.DropCover;
 import com.netease.nim.uikit.common.ui.drop.DropFake;
 import com.netease.nim.uikit.common.ui.drop.DropManager;
@@ -39,16 +46,26 @@ import com.netease.nimlib.sdk.msg.constant.SessionTypeEnum;
 import com.netease.nimlib.sdk.msg.model.IMMessage;
 import com.netease.nimlib.sdk.msg.model.RecentContact;
 import com.netease.nimlib.sdk.team.TeamService;
+import com.netease.nimlib.sdk.uinfo.UserService;
+import com.netease.nimlib.sdk.uinfo.constant.UserInfoFieldEnum;
+import com.netease.nimlib.sdk.uinfo.model.NimUserInfo;
 import com.sheishuo.app.R;
 import com.sheishuo.app.cache.AccountCache;
+import com.sheishuo.app.cache.SocialInfoCache;
+import com.sheishuo.app.common.beans.SocialInfoBean;
+import com.sheishuo.app.common.beans.TradeBean;
 import com.sheishuo.app.common.ui.viewpager.FadeInOutPageTransformer;
 import com.sheishuo.app.common.ui.viewpager.PagerSlidingTabStrip;
+import com.sheishuo.app.common.util.net.NetImpl;
+import com.sheishuo.app.common.util.net.ResponseCallback;
 import com.sheishuo.app.common.views.BottomNavigationViewEx;
 import com.sheishuo.app.core_module.circle.activity.NewCommentActivity;
 import com.sheishuo.app.core_module.location.LocationSelectActivity;
 import com.sheishuo.app.core_module.mine.view.ui.activity.MineUploadPhotoActivity;
+import com.sheishuo.app.core_module.mine.view.ui.activity.UserInfoSettingActivity;
 import com.sheishuo.app.core_module.trade.view.ui.activity.TradeChangePriorityActivity;
 import com.sheishuo.app.core_module.trade.view.ui.activity.TradeSearchActivity;
+import com.sheishuo.app.login.beans.LoginBean;
 import com.sheishuo.app.main.activity.MainActivity;
 import com.sheishuo.app.main.adapter.MainTabPagerAdapter;
 import com.sheishuo.app.main.helper.SystemMessageUnreadManager;
@@ -59,8 +76,10 @@ import com.sheishuo.app.main.reminder.ReminderManager;
 import com.sheishuo.app.team.TeamCreateHelper;
 
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 
 /**
@@ -107,9 +126,86 @@ public class HomeFragment extends TFragment implements OnPageChangeListener, Rem
         registerSystemMessageObservers(true);
         requestSystemMessageUnreadCount();
         initUnreadCover();
-        autoJoinAreaChat();
 
 
+        checkNick();
+    }
+
+    private void checkNick()
+    {
+        final NimUserInfo userInfo = NIMClient.getService(UserService.class).getUserInfo(AccountCache.getAccount().getId());
+        if(TextUtils.isEmpty((userInfo.getName())))
+        {
+            final EasyEditDialog requestDialog = new EasyEditDialog(getActivity());
+            requestDialog.setEditTextMaxLength(200);
+            requestDialog.setTitle("设置昵称");
+            requestDialog.setEditHint("请输入昵称...");
+            requestDialog.setCancelable(false);
+            requestDialog.addNegativeButtonListener(R.string.cancel, new View.OnClickListener() {
+                @Override
+                public void onClick(View v) {
+                    Toast.makeText(getActivity(), "昵称不能为空", Toast.LENGTH_SHORT).show();
+                }
+            });
+            requestDialog.addPositiveButtonListener(R.string.ok, new View.OnClickListener() {
+                @Override
+                public void onClick(View v) {
+                    String content = requestDialog.getEditMessage();
+                    if(!TextUtils.isEmpty(content)) {
+                        requestDialog.dismiss();
+                        updateNick(content);
+                    }
+                    else
+                    {
+                        Toast.makeText(getActivity(), "昵称不能为空", Toast.LENGTH_SHORT).show();
+                    }
+                }
+            });
+            requestDialog.show();
+        }
+        else
+        {
+            checkAutoJoin();
+        }
+    }
+
+    private void updateNick(final String nick)
+    {
+        new NetImpl().updateNick(nick, new ResponseCallback() {
+            @Override
+            public void onSuccess(Object object) {
+                Map<UserInfoFieldEnum, Object> fieldMap = new HashMap<>();
+                fieldMap.put(UserInfoFieldEnum.Name, nick);
+                NIMClient.getService(UserService.class).updateUserInfo(fieldMap);
+                SocialInfoBean bean = SocialInfoCache.get(AccountCache.getAccount().getId());
+                if(bean != null)
+                    bean.setNick(nick);
+                AccountCache.getAccount().setNick(nick);
+                checkAutoJoin();
+            }
+
+            @Override
+            public void onFailed(final String error) {
+                getHandler().post(new Runnable() {
+                    @Override
+                    public void run() {
+                        EasyAlertDialogHelper.showOneButtonDiolag(getContext(), "错误", error, "确认", false, new View.OnClickListener() {
+                            @Override
+                            public void onClick(View v) {
+                                checkNick();
+                            }
+                        });
+                    }
+                });
+            }
+        });
+
+
+    }
+
+    private void checkAutoJoin()
+    {
+        autoJoinAreaChat();
         //暂时用来解决无法加载首页的bug
         getHandler().postDelayed(new Runnable() {
             @Override
@@ -119,13 +215,15 @@ public class HomeFragment extends TFragment implements OnPageChangeListener, Rem
                 onPageSelected(0);
             }
         }, 300);
-
-
     }
 
 
     //自动加入地区群聊
     public void autoJoinAreaChat() {
+
+        if(AccountCache.getAccount() == null)
+            return;
+
         List<String> autoJoinList = new ArrayList<>();
         autoJoinList.add(AccountCache.getAccount().getCountry_room_id());
         autoJoinList.add(AccountCache.getAccount().getProvince_room_id());
@@ -133,7 +231,10 @@ public class HomeFragment extends TFragment implements OnPageChangeListener, Rem
         autoJoinList.add(AccountCache.getAccount().getDistrict_room_id());
 
         for (String roomId : autoJoinList) {
-            if (roomId != null) NIMClient.getService(TeamService.class).applyJoinTeam(roomId, null);
+            if (roomId != null) {
+                NIMClient.getService(TeamService.class).applyJoinTeam(roomId, null);
+                break;
+            }
         }
 
     }
@@ -269,7 +370,6 @@ public class HomeFragment extends TFragment implements OnPageChangeListener, Rem
 //            if (fragment instanceof MineFragment)
 //                fragment.setUserVisibleHint(true);
 //        }
-
     }
 
     @Override

+ 18 - 10
app/src/com/sheishuo/app/main/fragment/MineFragment.java

@@ -271,7 +271,7 @@ public class MineFragment extends MainTabFragment implements View.OnClickListene
                         }
 
                         @Override
-                        public void onFailed() {
+                        public void onFailed(String error) {
                             showToast("更新背景图失败");
                         }
                     });
@@ -279,7 +279,7 @@ public class MineFragment extends MainTabFragment implements View.OnClickListene
                 }
             } else {
                 //相册
-                List<PhotoInfo> photoInfoList = (List<PhotoInfo>) result.getSerializable("photo_list");
+                final List<PhotoInfo> photoInfoList = (List<PhotoInfo>) result.getSerializable("photo_list");
                 if (requestCode == AVATAR_SELECTED){
                     new Handler().postDelayed(outimeTask, PersonalSettingsActivity.AVATAR_TIME_OUT);
                     uploadAvatarFuture = NIMClient.getService(NosService.class).upload(new File(photoInfoList.get(0).getAbsolutePath()), PickImageAction.MIME_JPEG);
@@ -310,10 +310,15 @@ public class MineFragment extends MainTabFragment implements View.OnClickListene
                     });
 
                 } else if (requestCode == BANNER_SELECTED){
-                    Glide.with(getActivity())
-                            .load(photoInfoList.get(0).getFilePath())
-                            .centerCrop()
-                            .into(bannerImg);
+                    getHandler().post(new Runnable() {
+                        @Override
+                        public void run() {
+                            Glide.with(getActivity())
+                                    .load(photoInfoList.get(0).getAbsolutePath())
+                                    .centerCrop()
+                                    .into(bannerImg);
+                        }
+                    });
                     net.updateBanner(photoInfoList.get(0).getAbsolutePath(), new ResponseCallback() {
                         @Override
                         public void onSuccess(Object object) {
@@ -321,7 +326,7 @@ public class MineFragment extends MainTabFragment implements View.OnClickListene
                         }
 
                         @Override
-                        public void onFailed() {
+                        public void onFailed(String error) {
                             showToast("更新背景图失败");
                         }
                     });
@@ -364,6 +369,9 @@ public class MineFragment extends MainTabFragment implements View.OnClickListene
 
 
     private void fetchSocialInfo(){
+        if(AccountCache.getAccount() == null)
+            return;
+
         net.getSocialInfo(AccountCache.getAccount().getId(), new ResponseCallback() {
             @Override
             public void onSuccess(Object object) {
@@ -371,7 +379,7 @@ public class MineFragment extends MainTabFragment implements View.OnClickListene
             }
 
             @Override
-            public void onFailed() {
+            public void onFailed(String error) {
                 showToast("个人社交资料加载失败");
             }
         });
@@ -424,7 +432,7 @@ public class MineFragment extends MainTabFragment implements View.OnClickListene
                 }
 
                 @Override
-                public void onFailed() {
+                public void onFailed(String error) {
                     showToast("获取用户照片墙失败");
                 }
             });
@@ -517,7 +525,7 @@ public class MineFragment extends MainTabFragment implements View.OnClickListene
             }
 
             @Override
-            public void onFailed() {
+            public void onFailed(String error) {
                 showToast("加载动态失败");
             }
         });

+ 1 - 1
app/src/com/sheishuo/app/main/fragment/SessionListFragment.java

@@ -186,7 +186,7 @@ public class SessionListFragment extends MainTabFragment {
             }
 
             @Override
-            public void onFailed() {
+            public void onFailed(String error) {
 
             }
         });

+ 31 - 5
app/src/com/sheishuo/app/main/fragment/TradeListFragment.java

@@ -112,7 +112,29 @@ public class TradeListFragment extends MainTabFragment {
         init();
     }
 
+    @Override
+    public void onResume() {
+        super.onResume();
+
+        if(AccountCache.lastPulishedTradeId > 0)
+        {
+            net.getTradeInfo("" + AccountCache.lastPulishedTradeId, new ResponseCallback() {
+                @Override
+                public void onSuccess(Object object) {
+                    TradeBean.DBean.ListBean bean = (TradeBean.DBean.ListBean)object;
+                    Intent intent = new Intent(getActivity(), TradeDetailsActivity.class);
+                    intent.putExtra(TradeDetailsActivity.DATA, bean);
+                    startActivity(intent);
+                }
+
+                @Override
+                public void onFailed(String error) {
 
+                }
+            });
+            AccountCache.lastPulishedTradeId = 0;
+        }
+    }
 
     private void findViews(){
         notificationLayout = findView(R.id.trade_list_notifications_layout);
@@ -128,7 +150,7 @@ public class TradeListFragment extends MainTabFragment {
         initToolbar();
         parent.setSupportActionBar(toolbar);
 
-        setLocationTxt(AccountCache.getAccount().getCity() + AccountCache.getAccount().getDistrict());
+        setLocationTxt(AccountCache.getAccount().getDistrict());
 
         layoutManager = new LinearLayoutManager(getActivity());
         loadTradeList(TYPE_TO_LOAD, PAGE_TO_LOAD);
@@ -168,6 +190,7 @@ public class TradeListFragment extends MainTabFragment {
                 showLocationSelect();
             }
         });
+        setLocationTxt(location);
         toolbar.setLeftItems(new View[]{leftIcon, toolbarLeftTxt});
 
         ImageView searchIcon = new ImageView(getContext());
@@ -252,7 +275,7 @@ public class TradeListFragment extends MainTabFragment {
             }
 
             @Override
-            public void onFailed() {
+            public void onFailed(String error) {
                 showToast("加载失败");
             }
         });
@@ -484,7 +507,7 @@ public class TradeListFragment extends MainTabFragment {
 //            }
 //
 //            @Override
-//            public void onFailed() {
+//            public void onFailed(String error) {
 //                showToast("更新地理位置失败,请检查定位权限");
 //            }
 //        });
@@ -526,7 +549,7 @@ public class TradeListFragment extends MainTabFragment {
             }
 
             @Override
-            public void onFailed() {
+            public void onFailed(String error) {
 
             }
         });
@@ -543,7 +566,7 @@ public class TradeListFragment extends MainTabFragment {
                 String area = CityDataHelper.getAllDistrict().get(options1).get(options2).get(options3);
 
                 updateAccountLocation(province, city, area);
-                setLocationTxt(city+area);
+                setLocationTxt(area);
             }
         });
     }
@@ -551,6 +574,9 @@ public class TradeListFragment extends MainTabFragment {
     private void setLocationTxt(String value)
     {
         location = value;
+        if(location == null)
+            return;
+
         if (location.length() > 6) {
             location = location.substring(0, 6) + "...";
         }

+ 3 - 3
app/src/com/sheishuo/app/main/model/CircleModel.java

@@ -50,14 +50,14 @@ public class CircleModel implements ICircle {
                         if (circleListBean.getC() == 0){
                             presenter.onCircleListLoaded(circleListBean);
                         }else {
-                            onFailed();
+                            onFailed(null);
                         }
 
                         NetStatus.IS_BUSY = false;
                     }
 
                     @Override
-                    public void onFailed() {
+                    public void onFailed(String error) {
                         presenter.showToast("加载失败,请检查网络");
                         NetStatus.IS_BUSY = false;
                     }
@@ -91,7 +91,7 @@ public class CircleModel implements ICircle {
                     }
 
                     @Override
-                    public void onFailed() {
+                    public void onFailed(String error) {
                         presenter.showToast("点赞失败");
                     }
                 });

+ 15 - 0
uikit/res-ptr2/drawable-v21/btn_login_selector.xml

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_pressed="false">
+        <shape android:shape="rectangle">
+            <corners android:radius="5dp" />
+            <solid android:color="@color/white" />
+        </shape>
+    </item>
+    <item android:state_pressed="true" >
+        <shape>
+            <corners android:radius="5dp" />
+            <solid android:width="3dp" android:color="@color/GreyWhite" />
+        </shape>
+    </item>
+</selector>

+ 20 - 19
uikit/res/layout/gift_panel.xml

@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:background="@drawable/nim_message_view_bottom"
@@ -90,10 +91,12 @@
             android:paddingStart="8dp">
 
             <TextView
+                android:id="@+id/gift_priority_tip"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_weight="9"
-                android:text="置顶" />
+                android:text="置顶"
+                android:textColor="@color/black" />
 
             <Spinner
                 android:id="@+id/gift_panel_spinner"
@@ -108,27 +111,13 @@
             android:orientation="horizontal"
             android:padding="8dp">
 
-            <TextView
-                android:layout_width="0dp"
-                android:layout_height="wrap_content"
-                android:layout_weight="2"
-                android:text="置顶数量" />
-
             <SeekBar
                 android:id="@+id/gift_panel_num_seekbar"
-                android:layout_width="0dp"
+                android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_weight="9"
-                android:max="25"
+                android:max="100"
                 android:progress="1" />
 
-            <TextView
-                android:id="@+id/gift_panel_num_TV"
-                android:layout_width="0dp"
-                android:layout_height="wrap_content"
-                android:layout_weight="1"
-                android:gravity="center"
-                android:text="1" />
         </LinearLayout>
 
         <TextView
@@ -136,7 +125,7 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_gravity="center"
-            android:layout_marginBottom="-5dp"
+            android:layout_marginBottom="-10dp"
             android:layout_marginTop="-5dp"
             android:enabled="false"
             android:text="一天可发布三条"
@@ -162,9 +151,11 @@
                 android:id="@+id/gift_panel_gift_message_ET"
                 android:layout_width="0dp"
                 android:layout_height="wrap_content"
+                android:layout_marginRight="5dp"
                 android:layout_weight="7"
+                android:background="@drawable/nim_progress_bar_background"
                 android:hint=""
-                android:maxLines="1" />
+                android:maxLines="3" />
 
             <Button
                 android:id="@+id/gift_panel_publish_btn"
@@ -176,6 +167,16 @@
                 android:textColor="@color/white" />
         </LinearLayout>
 
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center"
+            android:layout_marginTop="-10dp"
+            android:enabled="false"
+            android:text="长按图片可删除"
+            android:textColor="@android:color/holo_red_dark"
+            android:textSize="10sp" />
+
         <HorizontalScrollView
             android:layout_width="wrap_content"
             android:layout_height="wrap_content">

+ 8 - 0
uikit/src/com/netease/nim/uikit/UIKitCache.java

@@ -2,6 +2,7 @@ package com.netease.nim.uikit;
 
 import com.google.gson.Gson;
 
+import java.text.DecimalFormat;
 import java.util.List;
 
 /**
@@ -322,6 +323,13 @@ public class UIKitCache {
                 return price;
             }
 
+            public String getSumPrice(int count)
+            {
+                DecimalFormat df = new DecimalFormat("###.##");
+                float f = Float.parseFloat(price) * count;
+                return df.format(f);
+            }
+
             public void setPrice(String price) {
                 this.price = price;
             }

+ 30 - 0
uikit/src/com/netease/nim/uikit/common/media/picker/PickImageHelper.java

@@ -96,4 +96,34 @@ public class PickImageHelper {
 
         dialog.show();
     }
+
+    public static void pickImageFromPhotoAlbum(final Context context, final int requestCode, final PickImageOption option) {
+        if (context == null) {
+            return;
+        }
+
+        int from = PickImageActivity.FROM_LOCAL;
+        if (!option.crop) {
+            PickImageActivity.start((Activity) context, requestCode, from, option.outputPath, option.multiSelect,
+                    option.multiSelectMaxCount, true, false, 0, 0);
+        } else {
+            PickImageActivity.start((Activity) context, requestCode, from, option.outputPath, false, 1,
+                    false, true, option.cropOutputImageWidth, option.cropOutputImageHeight);
+        }
+    }
+
+    public static void pickImageFromCamera(final Context context, final int requestCode, final PickImageOption option) {
+        if (context == null) {
+            return;
+        }
+
+        int from = PickImageActivity.FROM_CAMERA;
+        if (!option.crop) {
+            PickImageActivity.start((Activity) context, requestCode, from, option.outputPath, option.multiSelect, 1,
+                    true, false, 0, 0);
+        } else {
+            PickImageActivity.start((Activity) context, requestCode, from, option.outputPath, false, 1,
+                    false, true, option.cropOutputImageWidth, option.cropOutputImageHeight);
+        }
+    }
 }

+ 28 - 0
uikit/src/com/netease/nim/uikit/session/actions/PickImageAction.java

@@ -67,6 +67,34 @@ public abstract class PickImageAction extends BaseAction {
         PickImageHelper.pickImage(getActivity(), requestCode, option);
     }
 
+    public void pickImageFromAlbum()
+    {
+        PickImageHelper.PickImageOption option = new PickImageHelper.PickImageOption();
+        option.titleResId = getTitleId();
+        option.multiSelect = multiSelect;
+        option.multiSelectMaxCount = PICK_IMAGE_COUNT;
+        option.crop = crop;
+        option.cropOutputImageWidth = PORTRAIT_IMAGE_WIDTH;
+        option.cropOutputImageHeight = PORTRAIT_IMAGE_WIDTH;
+        option.outputPath = tempFile();
+
+        PickImageHelper.pickImageFromPhotoAlbum(getActivity(), makeRequestCode(RequestCode.PICK_IMAGE), option);
+    }
+
+    public void pickImageFromCamera()
+    {
+        PickImageHelper.PickImageOption option = new PickImageHelper.PickImageOption();
+        option.titleResId = getTitleId();
+        option.multiSelect = multiSelect;
+        option.multiSelectMaxCount = PICK_IMAGE_COUNT;
+        option.crop = crop;
+        option.cropOutputImageWidth = PORTRAIT_IMAGE_WIDTH;
+        option.cropOutputImageHeight = PORTRAIT_IMAGE_WIDTH;
+        option.outputPath = tempFile();
+
+        PickImageHelper.pickImageFromCamera(getActivity(), makeRequestCode(RequestCode.PICK_IMAGE), option);
+    }
+
     @Override
     public void onActivityResult(int requestCode, int resultCode, Intent data) {
         switch (requestCode) {

+ 1 - 0
uikit/src/com/netease/nim/uikit/session/activity/WatchPictureActivity.java

@@ -95,6 +95,7 @@ public class WatchPictureActivity extends UI {
         WatchPictureData data = new WatchPictureData(picPathList, thumbPathList, firstIndex);
         intent.putExtra(INTENT_EXTRA_IMAGE, data);
         intent.setClass(context, WatchPictureActivity.class);
+        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
         context.startActivity(intent);
     }
 

+ 6 - 5
uikit/src/com/netease/nim/uikit/session/helper/TeamNotificationHelper.java

@@ -150,11 +150,12 @@ public class TeamNotificationHelper {
     private static String buildLeaveTeamNotification(String fromAccount) {
         String tip;
         Team team = TeamDataCache.getInstance().getTeamById(teamId.get());
-        if (team.getType() == TeamTypeEnum.Advanced) {
-            tip = " 离开了聊天室";
-        } else {
-            tip = " 离开了讨论组";
-        }
+//        if (team.getType() == TeamTypeEnum.Advanced) {
+//            tip = " 离开了聊天室";
+//        } else {
+//            tip = " 离开了讨论组";
+//        }
+        tip = " 离开了聊天室";
         return getTeamMemberDisplayName(fromAccount) + tip;
     }
 

+ 16 - 4
uikit/src/com/netease/nim/uikit/session/module/gift/GiftPanel.java

@@ -38,7 +38,7 @@ public class GiftPanel extends LinearLayout{
     private TextView balanceTV
             ,rechargeTV
             ,selectPersonTV
-            ,giftNumTV;
+            ,priorityTip;
 
     private EditText messageET;
     private SeekBar numSeekBar;
@@ -84,7 +84,7 @@ public class GiftPanel extends LinearLayout{
         balanceTV = findView(R.id.gift_panel_balance_TV);
         rechargeTV = findView(R.id.gift_panel_recharge_TV);
         selectPersonTV = findView(R.id.gift_panel_select_person_TV);
-        giftNumTV = findView(R.id.gift_panel_num_TV);
+        priorityTip = findView(R.id.gift_priority_tip);
         messageET = findView(R.id.gift_panel_gift_message_ET);
         numSeekBar = findView(R.id.gift_panel_num_seekbar);
         recyclerView = findView(R.id.gift_panel_recyclerview);
@@ -145,8 +145,12 @@ public class GiftPanel extends LinearLayout{
         numSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
             @Override
             public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
-                giftNumTV.setText(String.valueOf(progress));
-                if (progress == 0) seekBar.setProgress(1);
+                if (progress == 0)
+                {
+                    seekBar.setProgress(1);
+                    progress = 1;
+                }
+                UpdatePriorityTip(progress);
             }
 
             @Override
@@ -172,6 +176,14 @@ public class GiftPanel extends LinearLayout{
 
     }
 
+    private void UpdatePriorityTip(int progress)
+    {
+        int index = 0;
+        String price = UIKitCache.getAccount().getTrade_priority().get(index).getSumPrice(progress);
+        String tip = "置顶x"+progress+"  共"+price+"说币";
+        priorityTip.setText(tip);
+    }
+
     public void closePanel(){
         this.setVisibility(GONE);
     }

+ 4 - 3
uikit/src/com/netease/nim/uikit/session/module/input/InputPanel.java

@@ -396,8 +396,8 @@ public class InputPanel implements IEmoticonSelectedListener, IAudioRecordCallba
                     }
                 };
                 action.setContainer(container);
-                action.onClick();
-
+//                action.onClick();
+                action.pickImageFromAlbum();
             }else if (v == sendPhotoBtn){
                 //发送拍照消息
                 PickImageAction action = new PickImageAction(R.string.add,R.string.add,true) {
@@ -408,7 +408,8 @@ public class InputPanel implements IEmoticonSelectedListener, IAudioRecordCallba
                     }
                 };
                 action.setContainer(container);
-                action.onClick();
+//                action.onClick();
+                action.pickImageFromCamera();
             }else if (v == sendLocationBtn){
                 //发送位置消息
                 NimUIKit.getLocationProvider().requestLocation(container.activity, new LocationProvider.Callback() {

+ 28 - 1
uikit/src/com/netease/nim/uikit/session/module/list/MessageListPanelEx.java

@@ -51,10 +51,12 @@ import com.netease.nimlib.sdk.msg.MsgService;
 import com.netease.nimlib.sdk.msg.MsgServiceObserve;
 import com.netease.nimlib.sdk.msg.attachment.AudioAttachment;
 import com.netease.nimlib.sdk.msg.attachment.FileAttachment;
+import com.netease.nimlib.sdk.msg.attachment.NotificationAttachment;
 import com.netease.nimlib.sdk.msg.constant.AttachStatusEnum;
 import com.netease.nimlib.sdk.msg.constant.MsgDirectionEnum;
 import com.netease.nimlib.sdk.msg.constant.MsgStatusEnum;
 import com.netease.nimlib.sdk.msg.constant.MsgTypeEnum;
+import com.netease.nimlib.sdk.msg.constant.NotificationType;
 import com.netease.nimlib.sdk.msg.constant.SessionTypeEnum;
 import com.netease.nimlib.sdk.msg.model.AttachmentProgress;
 import com.netease.nimlib.sdk.msg.model.IMMessage;
@@ -282,7 +284,7 @@ public class MessageListPanelEx {
         boolean needRefresh = false;
         List<IMMessage> addedListItems = new ArrayList<>(messages.size());
         for (IMMessage message : messages) {
-            if (isMyMessage(message)) {
+            if (isMyMessage(message) && checkShow(message)) {
                 items.add(message);
                 addedListItems.add(message);
                 needRefresh = true;
@@ -306,6 +308,21 @@ public class MessageListPanelEx {
         }
     }
 
+    private boolean checkShow(IMMessage message)
+    {
+        if(message.getMsgType() == MsgTypeEnum.notification)
+        {
+            NotificationAttachment attachment = (NotificationAttachment) message.getAttachment();
+            if(attachment == null)
+                return true;
+
+            if(attachment.getType() == NotificationType.PassTeamApply || attachment.getType() == NotificationType.LeaveTeam)
+                return false;
+        }
+
+        return true;
+    }
+
     private boolean isLastMessageVisible() {
         LinearLayoutManager layoutManager = (LinearLayoutManager) messageListView.getLayoutManager();
         int lastVisiblePosition = layoutManager.findLastCompletelyVisibleItemPosition();
@@ -614,6 +631,16 @@ public class MessageListPanelEx {
                 }
             }
 
+            for(int i=0; i<messages.size(); i++)
+            {
+                IMMessage message = messages.get(i);
+                if(!checkShow(message))
+                {
+                    messages.remove(i);
+                    i--;
+                }
+            }
+
             // 加入anchor
             if (firstLoad && anchor != null) {
                 messages.add(anchor);

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.