Browse Source

修复部分tower bug

Fenix Wang 8 years ago
parent
commit
049947e1e3
48 changed files with 1418 additions and 464 deletions
  1. 7 7
      app/app.iml
  2. 1 0
      app/res/layout/area_groups_list_fragment.xml
  3. 2 0
      app/res/layout/circle_details.xml
  4. 3 0
      app/res/layout/circle_item.xml
  5. 1 0
      app/res/layout/friends_add_new_friend.xml
  6. 6 3
      app/res/layout/item_hobby_select_checkbox.xml
  7. 164 124
      app/res/layout/login_and_reg_login_layout.xml
  8. 1 1
      app/res/layout/main.xml
  9. 1 0
      app/res/layout/mine_about_sheishuo.xml
  10. 1 1
      app/res/layout/mine_about_webview_activity.xml
  11. 57 38
      app/res/layout/mine_complaint_activity.xml
  12. 4 5
      app/res/layout/mine_hobby_select_activity.xml
  13. 2 2
      app/res/layout/mine_personal_settings.xml
  14. 9 0
      app/res/layout/mine_user_info_details.xml
  15. 0 0
      app/res/layout/register_layout.xml
  16. 39 20
      app/res/layout/trade_change_priority.xml
  17. 2 4
      app/res/layout/trade_details.xml
  18. 1 0
      app/res/layout/trade_list_item.xml
  19. 40 2
      app/res/layout/trade_pay_method_activity.xml
  20. 43 0
      app/res/layout/trade_popup.xml
  21. 141 93
      app/res/layout/trade_recharge_activity.xml
  22. 1 0
      app/src/com/sheishuo/app/common/util/net/NetInfo.java
  23. 19 0
      app/src/com/sheishuo/app/core_module/circle/activity/CircleDetailsActivity.java
  24. 6 0
      app/src/com/sheishuo/app/core_module/mine/view/ui/activity/AboutWebViewActivity.java
  25. 11 2
      app/src/com/sheishuo/app/core_module/mine/view/ui/activity/ComplaintActivity.java
  26. 80 12
      app/src/com/sheishuo/app/core_module/mine/view/ui/activity/HobbySelectActivity.java
  27. 86 1
      app/src/com/sheishuo/app/core_module/mine/view/ui/activity/MineTradeActivity.java
  28. 84 26
      app/src/com/sheishuo/app/core_module/mine/view/ui/activity/PersonalSettingsActivity.java
  29. 8 1
      app/src/com/sheishuo/app/core_module/mine/view/ui/activity/UserInfoDetailActivity.java
  30. 8 0
      app/src/com/sheishuo/app/core_module/mine/view/ui/activity/UserInfoSettingActivity.java
  31. 7 0
      app/src/com/sheishuo/app/core_module/sheishuo/view/ui/SettingTextEditActivity.java
  32. 39 0
      app/src/com/sheishuo/app/core_module/trade/model/TradeModel.java
  33. 28 0
      app/src/com/sheishuo/app/core_module/trade/presenter/TradePresenter.java
  34. 12 3
      app/src/com/sheishuo/app/core_module/trade/view/adapter/TradeItemAdapter.java
  35. 61 0
      app/src/com/sheishuo/app/core_module/trade/view/popup/TradeSortPopupWindow.java
  36. 23 1
      app/src/com/sheishuo/app/core_module/trade/view/ui/activity/PayMethodActivity.java
  37. 45 11
      app/src/com/sheishuo/app/core_module/trade/view/ui/activity/RechargeActivity.java
  38. 7 1
      app/src/com/sheishuo/app/core_module/trade/view/ui/activity/TradeChangePriorityActivity.java
  39. 69 1
      app/src/com/sheishuo/app/core_module/trade/view/ui/activity/TradeDetailsActivity.java
  40. 102 0
      app/src/com/sheishuo/app/login/LoginActivity.java
  41. 86 4
      app/src/com/sheishuo/app/login/RegisterActivity.java
  42. 10 3
      app/src/com/sheishuo/app/main/adapter/CircleListAdapter.java
  43. 1 1
      app/src/com/sheishuo/app/main/adapter/OnCircleItemClickListener.java
  44. 9 1
      app/src/com/sheishuo/app/main/fragment/AreaGroupsFragment.java
  45. 6 0
      app/src/com/sheishuo/app/main/fragment/CircleOfFriendsFragment.java
  46. 71 94
      app/src/com/sheishuo/app/main/fragment/TradeListFragment.java
  47. 13 1
      uikit/res/layout/gift_panel.xml
  48. 1 1
      uikit/src/com/netease/nim/uikit/session/activity/TeamMessageActivity.java

+ 7 - 7
app/app.iml

@@ -59,13 +59,6 @@
       <sourceFolder url="file://$MODULE_DIR$/assets" type="java-resource" />
       <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
       <sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
-      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
-      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
-      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
-      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
-      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
-      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
-      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
       <sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
       <sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
       <sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
@@ -73,6 +66,13 @@
       <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
       <sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
       <sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
+      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
+      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
+      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
+      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
+      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
+      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
+      <sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/builds" />

+ 1 - 0
app/res/layout/area_groups_list_fragment.xml

@@ -80,6 +80,7 @@
                 android:text="附近群" />
 
             <TextView
+                android:id="@+id/create_area_group"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:gravity="end"

+ 2 - 0
app/res/layout/circle_details.xml

@@ -102,6 +102,7 @@
                     <ImageView
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
+                        android:visibility="gone"
                         android:src="@drawable/circle_eye" />
 
                     <TextView
@@ -109,6 +110,7 @@
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:text="123"
+                        android:visibility="gone"
                         android:textColor="@color/grey_light" />
 
                     <ImageView

+ 3 - 0
app/res/layout/circle_item.xml

@@ -24,6 +24,7 @@
             android:padding="8dp">
 
             <LinearLayout
+                android:id="@+id/avatar_container"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content">
 
@@ -105,6 +106,7 @@
                         <ImageView
                             android:layout_width="30dp"
                             android:layout_height="match_parent"
+                            android:visibility="gone"
                             android:src="@drawable/circle_eye" />
 
                         <TextView
@@ -113,6 +115,7 @@
                             android:layout_height="match_parent"
                             android:gravity="center"
                             android:text="浏览数"
+                            android:visibility="gone"
                             android:textColor="@android:color/darker_gray"/>
 
                         <ImageView

+ 1 - 0
app/res/layout/friends_add_new_friend.xml

@@ -3,6 +3,7 @@
     android:orientation="vertical" android:layout_width="match_parent"
     android:layout_height="match_parent">
     <com.sheishuo.app.common.views.BaseToolbar
+        android:id="@id/toolbar"
         android:layout_width="match_parent"
         android:layout_height="@dimen/action_bar_height"
         style="@style/fullToolbarStyle"/>

+ 6 - 3
app/res/layout/item_hobby_select_checkbox.xml

@@ -1,10 +1,13 @@
 <?xml version="1.0" encoding="utf-8"?>
 <CheckBox xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical" android:layout_width="wrap_content"
+    android:layout_width="match_parent"
     android:layout_height="wrap_content"
+    android:layout_columnWeight="1"
+    android:layout_margin="5dp"
     android:background="@drawable/selector_radiobutton_rc_bg_green"
+    android:button="@null"
     android:gravity="center"
-    android:padding="8dp"
-    android:button="@null">
+    android:orientation="vertical"
+    android:padding="8dp">
 
 </CheckBox>

+ 164 - 124
app/res/layout/login_and_reg_login_layout.xml

@@ -1,146 +1,186 @@
 <?xml version="1.0" encoding="utf-8"?>
-<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<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.support.design.widget.AppBarLayout
         android:id="@+id/app_bar_layout"
-        android:layout_width="0dp"
+        android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:theme="@style/AppTheme.AppBarOverlay"
-        app:elevation="0dp"
         android:weightSum="1"
-        app:layout_constraintRight_toRightOf="parent"
-        app:layout_constraintLeft_toLeftOf="parent"
+        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:layout_weight="1.21">
-        </android.support.v7.widget.Toolbar>
+            app:titleTextAppearance="@style/Toolbar.TitleText"></android.support.v7.widget.Toolbar>
     </android.support.design.widget.AppBarLayout>
 
-    <TextView
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="欢迎来到谁说"
-        android:layout_marginTop="25dp"
-        app:layout_constraintTop_toBottomOf="@+id/app_bar_layout"
-        android:layout_marginStart="36dp"
-        android:textStyle="bold"
-        android:textSize="25sp"
-        android:typeface="monospace"
-        android:id="@+id/textView3"
-        android:layout_marginLeft="36dp"
-        app:layout_constraintLeft_toLeftOf="parent" />
-    <TextView
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="请输入您的登录信息"
-        android:layout_marginLeft="36dp"
-        android:layout_marginStart="36dp"
-        app:layout_constraintLeft_toLeftOf="parent"
-        android:layout_marginTop="8dp"
-        app:layout_constraintTop_toBottomOf="@+id/textView3"
-        android:id="@+id/textView4"
-        android:layout_marginBottom="8dp"
-        app:layout_constraintBottom_toTopOf="@+id/login_tel"
-        app:layout_constraintVertical_bias="0.074" />
-
-    <com.netease.nim.uikit.common.ui.widget.ClearableEditTextWithIcon
-        android:id="@+id/login_tel"
-        android:layout_width="300dp"
-        android:layout_height="wrap_content"
-        android:maxLines="1"
-        android:hint="@string/please_input_tel_num"
-        android:layout_marginStart="36dp"
-        android:layout_marginRight="8dp"
-        app:layout_constraintRight_toRightOf="@+id/app_bar_layout"
-        android:layout_marginLeft="36dp"
-        app:layout_constraintLeft_toLeftOf="@+id/app_bar_layout"
-        app:layout_constraintHorizontal_bias="0.117"
-        android:layout_marginTop="195dp"
-        app:layout_constraintTop_toBottomOf="@+id/app_bar_layout"
-        android:layout_marginEnd="8dp" />
-
-    <com.netease.nim.uikit.common.ui.widget.ClearableEditTextWithIcon
-        android:id="@+id/login_password"
-        android:layout_width="300dp"
-        android:layout_height="wrap_content"
-        android:maxLines="1"
-        android:hint="@string/please_input_pwd"
-        android:layout_marginTop="22dp"
-        app:layout_constraintTop_toBottomOf="@+id/login_tel"
-        app:layout_constraintLeft_toLeftOf="@+id/login_tel"
-        android:inputType="textPassword"
-        android:layout_marginRight="8dp"
-        app:layout_constraintRight_toRightOf="@+id/login_tel"
-        android:layout_marginEnd="8dp"
-        app:layout_constraintHorizontal_bias="0.0" />
-
-    <TextView
-        android:id="@+id/forgot_password"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="忘记密码?"
-        android:textColor="@color/grey_light"
-        android:layout_marginTop="9dp"
-        app:layout_constraintTop_toBottomOf="@+id/login_password"
-        app:layout_constraintRight_toRightOf="@+id/login_password" />
-
-    <Button
-        android:id="@+id/login_btn"
-        android:layout_width="300dp"
-        android:layout_height="wrap_content"
-        style="@style/NormalBtnStyle"
-        android:layout_marginTop="47dp"
-        app:layout_constraintTop_toBottomOf="@+id/login_password"
-        app:layout_constraintLeft_toLeftOf="@+id/login_password"
-        android:text="@string/login"
-        android:layout_marginRight="8dp"
-        app:layout_constraintRight_toRightOf="@+id/login_password"
-        android:layout_marginEnd="8dp"
-        app:layout_constraintHorizontal_bias="0.0" />
-
-    <com.sheishuo.app.common.views.PartlyHighLightTextView xmlns:app="http://schemas.android.com/apk/res-auto"
-        android:id="@+id/rules_tv"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        app:normal_str="登录代表您已同意"
-        app:hightlight_str=" 《用户注册协议》 "
-        android:layout_marginTop="8dp"
-        app:layout_constraintTop_toBottomOf="@+id/login_btn"
-        android:layout_marginLeft="8dp"
-        app:layout_constraintLeft_toLeftOf="@+id/login_btn"
-        android:layout_marginRight="8dp"
-        app:layout_constraintRight_toRightOf="@+id/login_btn"
-        android:layout_marginStart="8dp"
-        android:layout_marginEnd="8dp" />
-
-
-    <com.sheishuo.app.common.views.PartlyHighLightTextView
-        android:id="@+id/register_tv"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        app:normal_str="还没有账号?"
-        app:hightlight_str="现在注册"
-        android:layout_marginTop="98dp"
-        app:layout_constraintTop_toBottomOf="@+id/rules_tv"
-        android:layout_marginLeft="8dp"
-        app:layout_constraintLeft_toLeftOf="@+id/rules_tv"
-        android:layout_marginRight="8dp"
-        app:layout_constraintRight_toRightOf="@+id/rules_tv"
-        app:layout_constraintHorizontal_bias="0.43"
-        app:layout_constraintBottom_toBottomOf="parent"
-        android:layout_marginBottom="8dp"
-        android:layout_marginStart="8dp"
-        android:layout_marginEnd="8dp" />
-</android.support.constraint.ConstraintLayout>
+    <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: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:visibility="gone"
+            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="20dp"
+            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_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/color_grey_666666"
+                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/color_green_00ae8c" />
+
+        </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">
+
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_gravity="bottom"
+            android:layout_marginBottom="5dp"
+            android:layout_weight="1"
+            android:text="还没有账号?"
+            android:textAlignment="textEnd" />
+
+        <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:layout_weight="1"
+            android:text="现在注册"
+            android:textAlignment="textStart"
+            android:textColor="@color/color_green_00ae8c" />
+
+    </LinearLayout>
+
+</RelativeLayout>

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

@@ -18,7 +18,7 @@
             android:layout_height="?attr/actionBarSize"
             android:background="?attr/colorPrimary"
             android:visibility="visible"
-            app:theme="@style/fullToolbarStyle"/>
+            style="@style/fullToolbarStyle"/>
     </android.support.design.widget.AppBarLayout>
 
     <com.sheishuo.app.common.ui.viewpager.PagerSlidingTabStrip

+ 1 - 0
app/res/layout/mine_about_sheishuo.xml

@@ -42,6 +42,7 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:text="谁说用户协议"
+            android:visibility="gone"
             android:textColor="#5779ff"/>
 
         <TextView

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

@@ -12,7 +12,7 @@
             android:id="@+id/toolbar"
             android:layout_width="match_parent"
             android:layout_height="@dimen/action_bar_height"
-            app:left_text="返回"/>
+            style="@style/fullToolbarStyle"/>
     </android.support.design.widget.AppBarLayout>
 
 

+ 57 - 38
app/res/layout/mine_complaint_activity.xml

@@ -1,20 +1,22 @@
 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
-    android:orientation="vertical"
     android:layout_width="match_parent"
-    android:layout_height="match_parent">
+    android:layout_height="match_parent"
+    android:background="@color/grey_light_light_light"
+    android:orientation="vertical">
 
     <android.support.design.widget.AppBarLayout
         android:layout_width="match_parent"
         android:layout_height="wrap_content">
+
         <com.sheishuo.app.common.views.BaseToolbar
             android:id="@+id/toolbar"
+            style="@style/fullToolbarStyle"
             android:layout_width="match_parent"
             android:layout_height="@dimen/action_bar_height"
-            app:title="投诉"
             app:left_text="返回"
-            style="@style/fullToolbarStyle"/>
+            app:title="投诉" />
     </android.support.design.widget.AppBarLayout>
 
 
@@ -23,41 +25,56 @@
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:orientation="vertical">
+
+        <TextView
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:paddingBottom="5dp"
+            android:paddingLeft="15dp"
+            android:paddingTop="30dp"
+            android:text="请选择要投诉的类型" />
+
         <RadioGroup
             android:id="@+id/mine_complaint_radiogroup"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
+            android:background="@color/color_white_ffffffff"
             android:padding="8dp">
-                <RadioButton
-                    android:id="@+id/mine_complaint_type_ad"
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:text="广告骚扰"
-                    android:padding="16dp"/>
-                <RadioButton
-                    android:id="@+id/mine_complaint_type_vulgar"
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:text="色情低俗"
-                    android:padding="16dp"/>
-                <RadioButton
-                    android:id="@+id/mine_complaint_type_politics"
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:text="政治敏感"
-                    android:padding="16dp"/>
-                <RadioButton
-                    android:id="@+id/mine_complaint_type_cheat"
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:text="欺诈骗钱"
-                    android:padding="16dp"/>
-                <RadioButton
-                    android:id="@+id/mine_complaint_type_illegal"
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:text="违法(暴力恐怖、违禁品等)"
-                    android:padding="16dp"/>
+
+            <RadioButton
+                android:id="@+id/mine_complaint_type_ad"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:padding="16dp"
+                android:text="广告骚扰" />
+
+            <RadioButton
+                android:id="@+id/mine_complaint_type_vulgar"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:padding="16dp"
+                android:text="色情低俗" />
+
+            <RadioButton
+                android:id="@+id/mine_complaint_type_politics"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:padding="16dp"
+                android:text="政治敏感" />
+
+            <RadioButton
+                android:id="@+id/mine_complaint_type_cheat"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:padding="16dp"
+                android:text="欺诈骗钱" />
+
+            <RadioButton
+                android:id="@+id/mine_complaint_type_illegal"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:padding="16dp"
+                android:text="违法(暴力恐怖、违禁品等)" />
         </RadioGroup>
 
 
@@ -68,20 +85,22 @@
         android:layout_width="match_parent"
         android:layout_height="150dp"
         android:visibility="gone">
+
         <EditText
             android:id="@+id/mine_complaint_reason_ET"
             android:layout_width="match_parent"
             android:layout_height="match_parent"
+            android:gravity="start"
             android:hint="请输入投诉理由"
-            android:textColorHint="@color/grey_light"
-            android:gravity="start"/>
+            android:textColorHint="@color/grey_light" />
     </LinearLayout>
+
     <Button
         android:id="@+id/mine_complaint_submit_btn"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
+        android:layout_margin="16dp"
         android:background="@drawable/btn1_selector"
         android:text="下一步"
-        android:textColor="@color/white"
-        android:layout_margin="16dp"/>
+        android:textColor="@color/white" />
 </LinearLayout>

+ 4 - 5
app/res/layout/mine_hobby_select_activity.xml

@@ -11,10 +11,7 @@
         <com.sheishuo.app.common.views.BaseToolbar
             android:id="@+id/toolbar"
             android:layout_width="match_parent"
-            android:layout_height="@dimen/action_bar_height"
-            app:title="兴趣爱好"
-            app:left_text="返回"
-            app:right_text="确认"/>
+            android:layout_height="@dimen/action_bar_height"/>
     </android.support.design.widget.AppBarLayout>
 
 
@@ -23,5 +20,7 @@
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:padding="16dp"
-        android:orientation="vertical"/>
+        android:orientation="vertical">
+
+    </LinearLayout>
 </LinearLayout>

+ 2 - 2
app/res/layout/mine_personal_settings.xml

@@ -291,7 +291,7 @@
                     android:layout_height="wrap_content"
                     android:gravity="center"
                     android:src="@drawable/nim_avatar_default"
-                    android:text="姓名" />
+                    android:text="请填写真实姓名" />
 
                 <ImageView
                     android:layout_width="wrap_content"
@@ -327,7 +327,7 @@
                     android:layout_height="wrap_content"
                     android:gravity="center"
                     android:src="@drawable/nim_avatar_default"
-                    android:text="身份证" />
+                    android:text="请填写身份证号码" />
 
                 <ImageView
                     android:layout_width="wrap_content"

+ 9 - 0
app/res/layout/mine_user_info_details.xml

@@ -36,6 +36,15 @@
                         android:src="@drawable/ico_userinfo_setting"
                         app:layout_anchorGravity="top|end" />
 
+                    <ImageView
+                        android:id="@+id/back_icon"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="top|start"
+                        android:layout_margin="8dp"
+                        android:src="@drawable/nim_actionbar_white_back_icon"
+                        app:layout_anchorGravity="top|end" />
+
                     <android.support.design.widget.CoordinatorLayout
                         android:id="@+id/user_info_details_coordinator_layout"
                         android:layout_width="match_parent"

File diff suppressed because it is too large
+ 0 - 0
app/res/layout/register_layout.xml


+ 39 - 20
app/res/layout/trade_change_priority.xml

@@ -1,39 +1,58 @@
 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
-    android:orientation="vertical"
     android:layout_width="match_parent"
-    android:layout_height="match_parent">.
+    android:layout_height="match_parent"
+    android:orientation="vertical">.
+
     <com.sheishuo.app.common.views.BaseToolbar
         android:id="@+id/toolbar"
+        style="@style/fullToolbarStyle"
         android:layout_width="match_parent"
         android:layout_height="@dimen/action_bar_height"
-        style="@style/fullToolbarStyle"
         android:title="修改置顶"
-        app:right_text="确定"/>
+        app:right_text="确定" />
 
     <LinearLayout
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:orientation="horizontal"
-        android:padding="8dp"
-        android:layout_gravity="center">
-        <SeekBar
-            android:id="@+id/trade_change_priority_seekBar"
-            android:layout_weight="9"
-            android:layout_width="0dp"
-            android:layout_height="match_parent"
-            android:max="100"
-            android:progress="1" />
+        android:gravity="center"
+        android:orientation="vertical">
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center"
+            android:orientation="horizontal"
+            android:padding="8dp">
+
+            <SeekBar
+                android:id="@+id/trade_change_priority_seekBar"
+                android:layout_width="0dp"
+                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
-            android:id="@+id/trade_change_priority_tv"
-            android:layout_weight="1"
-            android:layout_width="wrap_content"
+            android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:text="x 1 国家道具"
-            android:layout_gravity="center"/>
-    </LinearLayout>
+            android:text="一天可发布三条,道具数量决定快讯排名"
+            android:textAlignment="center"
+            android:textColor="@android:color/holo_red_dark"
+            android:textSize="10sp" />
 
+    </LinearLayout>
 
 
 </LinearLayout>

+ 2 - 4
app/res/layout/trade_details.xml

@@ -85,7 +85,7 @@
 
                 <LinearLayout
                     android:id="@+id/trade_details_img_layout"
-                    android:layout_width="match_parent"
+                    android:layout_width="0dp"
                     android:layout_height="wrap_content"
                     android:layout_marginTop="16dp"
                     android:orientation="vertical"
@@ -110,11 +110,9 @@
                     android:id="@+id/trade_details_read_num"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
-                    android:layout_marginEnd="16dp"
-                    android:layout_marginRight="16dp"
-                    android:layout_marginTop="8dp"
                     android:padding="4dp"
                     android:text="阅读量123"
+                    android:visibility="gone"
                     android:textColor="@color/grey_light_light"
                     app:layout_constraintRight_toRightOf="parent"
                     app:layout_constraintTop_toBottomOf="@+id/trade_details_date" />

+ 1 - 0
app/res/layout/trade_list_item.xml

@@ -106,6 +106,7 @@
             android:layout_height="wrap_content"
             android:text="阅读103"
             android:padding="4dp"
+            android:visibility="gone"
             android:layout_marginRight="0dp"
             app:layout_constraintRight_toRightOf="@+id/trade_list_item_imgs_gridview"
             android:layout_marginTop="8dp"

+ 40 - 2
app/res/layout/trade_pay_method_activity.xml

@@ -13,18 +13,55 @@
             android:id="@+id/toolbar"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            app:title="支付方式" />
+            style="@style/fullToolbarStyle"/>
     </android.support.design.widget.AppBarLayout>
 
     <LinearLayout
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal"
+        android:padding="15dp">
+
+        <TextView
+            android:id="@+id/textView6"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:text="充值金额:" />
+
+        <TextView
+            android:id="@+id/recharge_money"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="10dp"
+            android:layout_weight="1"
+            android:text="TextView"
+            android:textColor="@android:color/holo_red_dark" />
+
+    </LinearLayout>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="5dp"
+        android:background="@color/grey_light_light"
+        android:orientation="horizontal"></LinearLayout>
+
+    <LinearLayout
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:orientation="vertical"
-        android:gravity="center">
+        android:padding="15dp">
+
+        <TextView
+            android:id="@+id/textView7"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:text="选择支付方式" />
 
         <LinearLayout
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
+            android:layout_marginTop="30dp"
             android:gravity="center"
             android:orientation="horizontal">
 
@@ -46,4 +83,5 @@
 
         </LinearLayout>
     </LinearLayout>
+
 </LinearLayout>

+ 43 - 0
app/res/layout/trade_popup.xml

@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:background="@color/GreyWhite"
+    android:orientation="vertical">
+
+    <RadioGroup
+        android:id="@+id/trade_sort_group"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:paddingLeft="10dp"
+        android:paddingRight="20dp">
+
+        <RadioButton
+            android:id="@+id/trade_sort_0"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:text="全部" />
+
+        <RadioButton
+            android:id="@+id/trade_sort_1"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:text="最近" />
+
+        <RadioButton
+            android:id="@+id/trade_sort_2"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:text="出售" />
+
+        <RadioButton
+            android:id="@+id/trade_sort_3"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:text="求购" />
+    </RadioGroup>
+</LinearLayout>

+ 141 - 93
app/res/layout/trade_recharge_activity.xml

@@ -5,124 +5,172 @@
     android:layout_height="match_parent"
     android:orientation="vertical">
 
-    <android.support.v7.widget.Toolbar
+    <com.sheishuo.app.common.views.BaseToolbar
         android:id="@+id/toolbar"
         android:layout_width="match_parent"
         android:layout_height="@dimen/action_bar_height"
-        android:background="@color/colorPrimary"
-        app:title="充值"
-        app:titleTextColor="@color/GreyWhite" />
+        style="@style/fullToolbarStyle"/>
 
 
-    <com.netease.nim.uikit.views.MutipleRadioGroup
-        android:id="@+id/trade_recharge_radiogroup"
+    <GridLayout
+        android:id="@+id/recharge_grid"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:orientation="vertical">
-
+        android:columnCount="3"
+        android:padding="15dp">
 
         <LinearLayout
-            android:layout_width="match_parent"
+            android:layout_width="0dp"
             android:layout_height="wrap_content"
+            android:layout_columnWeight="1"
+            android:background="@drawable/ico_recharge_unchecked"
             android:gravity="center"
-            android:orientation="horizontal">
-
-            <RadioButton
-                android:id="@+id/trade_recharge_rd1"
-                android:layout_width="0dp"
-                android:layout_height="64dp"
-                android:layout_margin="16dp"
-                android:layout_weight="1"
-                android:background="@drawable/selector_radiobutton_recharge_style"
-                android:button="@null"
-                android:gravity="center"
+            android:orientation="vertical">
+
+            <TextView
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
                 android:text="20元"
-                android:textSize="27sp" />
-
-            <RadioButton
-                android:id="@+id/trade_recharge_rd2"
-                android:layout_width="0dp"
-                android:layout_height="64dp"
-                android:layout_margin="16dp"
-                android:layout_weight="1"
-                android:background="@drawable/selector_radiobutton_recharge_style"
-                android:button="@null"
-                android:gravity="center"
+                android:textAlignment="center"
+                android:textColor="@color/black" />
+
+            <TextView
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="10dp"
+                android:text="20说币"
+                android:textAlignment="center" />
+
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_columnWeight="1"
+            android:layout_marginLeft="10dp"
+            android:layout_marginRight="10dp"
+            android:background="@drawable/ico_recharge_unchecked"
+            android:gravity="center"
+            android:orientation="vertical">
+
+            <TextView
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
                 android:text="30元"
-                android:textSize="27sp" />
-
-            <RadioButton
-                android:id="@+id/trade_recharge_rd3"
-                android:layout_width="0dp"
-                android:layout_height="64dp"
-                android:layout_margin="16dp"
-                android:layout_weight="1"
-                android:background="@drawable/selector_radiobutton_recharge_style"
-                android:button="@null"
-                android:gravity="center"
+                android:textAlignment="center"
+                android:textColor="@color/black" />
+
+            <TextView
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="10dp"
+                android:text="30说币"
+                android:textAlignment="center" />
+
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_columnWeight="1"
+            android:background="@drawable/ico_recharge_unchecked"
+            android:gravity="center"
+            android:orientation="vertical">
+
+            <TextView
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
                 android:text="50元"
-                android:textSize="27sp" />
+                android:textAlignment="center"
+                android:textColor="@color/black" />
+
+            <TextView
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="10dp"
+                android:text="50说币"
+                android:textAlignment="center" />
+
         </LinearLayout>
 
         <LinearLayout
-            android:layout_width="match_parent"
+            android:layout_width="0dp"
             android:layout_height="wrap_content"
+            android:layout_columnWeight="1"
+            android:layout_marginTop="10dp"
+            android:background="@drawable/ico_recharge_unchecked"
             android:gravity="center"
-            android:orientation="horizontal">
-
-            <RadioButton
-                android:id="@+id/trade_recharge_rd4"
-                android:layout_width="0dp"
-                android:layout_height="64dp"
-                android:layout_margin="16dp"
-                android:layout_weight="1"
-                android:background="@drawable/selector_radiobutton_recharge_style"
-                android:button="@null"
-                android:gravity="center"
+            android:orientation="vertical">
+
+            <TextView
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
                 android:text="100元"
-                android:textSize="27sp" />
-
-            <RadioButton
-                android:id="@+id/trade_recharge_rd5"
-                android:layout_width="0dp"
-                android:layout_height="64dp"
-                android:layout_margin="16dp"
-                android:layout_weight="1"
-                android:background="@drawable/selector_radiobutton_recharge_style"
-                android:button="@null"
-                android:gravity="center"
+                android:textAlignment="center"
+                android:textColor="@color/black" />
+
+            <TextView
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="10dp"
+                android:text="100说币"
+                android:textAlignment="center" />
+
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_columnWeight="1"
+            android:layout_marginLeft="10dp"
+            android:layout_marginRight="10dp"
+            android:layout_marginTop="10dp"
+            android:background="@drawable/ico_recharge_unchecked"
+            android:gravity="center"
+            android:orientation="vertical">
+
+            <TextView
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
                 android:text="200元"
-                android:textSize="27sp" />
-
-            <RadioButton
-                android:id="@+id/trade_recharge_rd6"
-                android:layout_width="0dp"
-                android:layout_height="64dp"
-                android:layout_margin="16dp"
-                android:layout_weight="1"
-                android:background="@drawable/selector_radiobutton_recharge_style"
-                android:button="@null"
-                android:gravity="center"
-                android:text="300元"
-                android:textSize="27sp" />
+                android:textAlignment="center"
+                android:textColor="@color/black" />
+
+            <TextView
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="10dp"
+                android:text="200说币"
+                android:textAlignment="center" />
+
         </LinearLayout>
 
         <LinearLayout
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content">
-
-            <RadioButton
-                android:id="@+id/trade_recharge_rd7"
-                android:layout_width="96dp"
-                android:layout_height="64dp"
-                android:layout_margin="16dp"
-                android:background="@drawable/selector_radiobutton_recharge_style"
-                android:button="@null"
-                android:gravity="center"
-                android:text="其他金额"
-                android:textSize="27sp" />
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_columnWeight="1"
+            android:layout_marginTop="10dp"
+            android:background="@drawable/ico_recharge_unchecked"
+            android:gravity="center"
+            android:orientation="vertical">
+
+            <TextView
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:text="300元"
+                android:textAlignment="center"
+                android:textColor="@color/black" />
+
+            <TextView
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="10dp"
+                android:text="300说币"
+                android:textAlignment="center" />
+
         </LinearLayout>
-    </com.netease.nim.uikit.views.MutipleRadioGroup>
+
+    </GridLayout>
 
 
     <Button

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

@@ -18,6 +18,7 @@ public class NetInfo {
     public final static String UPLOAD_IMG = INDEX + "?m=who&c=social&a=upload";
     public final static String UPLOAD_SOCIAL_PHOTO = INDEX + "?m=who&c=social&a=photo_upload";
     public final static String TRADE_LIST = INDEX + "?m=who&c=trade&a=lists";
+    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";
     public final static String GET_SOCIAL_INFO = INDEX + "?m=who&c=social&a=get_user";

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

@@ -19,6 +19,7 @@ import com.sheishuo.app.common.util.img.ImgUtil;
 import com.sheishuo.app.common.views.BaseToolbar;
 import com.sheishuo.app.common.views.ImgGridView;
 import com.sheishuo.app.common.views.PartlyHighLightTextView;
+import com.sheishuo.app.core_module.mine.view.ui.activity.UserInfoDetailActivity;
 import com.sheishuo.app.impl.SheishuoUI;
 
 import jp.wasabeef.glide.transformations.CropCircleTransformation;
@@ -98,9 +99,21 @@ public class CircleDetailsActivity extends SheishuoUI {
                     .load(getUserInfo(bean.getUser_id()).getAvatar())
                     .into(avatar);
         }
+        avatar.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                showUserInfo();
+            }
+        });
 
         //设置用户名
         nameTV.setText(getName(bean.getUser_id()));
+        nameTV.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                showUserInfo();
+            }
+        });
 
         //显示发布时间
         dateTV.setText(bean.getInputtime());
@@ -207,6 +220,12 @@ public class CircleDetailsActivity extends SheishuoUI {
 
     }
 
+
+    private void showUserInfo()
+    {
+        UserInfoDetailActivity.start(getBaseContext(), bean.getUser_id());
+    }
+
     //动态添加Comment
     private View createComment(CircleBean.DBean.ListBean.Comment comment){
         LinearLayout commentView = (LinearLayout) LayoutInflater.from(context).inflate(R.layout.circle_details_comment_layout,null);

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

@@ -61,6 +61,12 @@ public class AboutWebViewActivity extends SheishuoUI{
 
     void init(){
         toolbar.setTitle(title);
+        toolbar.setBackOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                finish();
+            }
+        });
 
         webView.loadUrl(url);
 

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

@@ -15,6 +15,7 @@ import android.widget.RadioGroup;
 import com.sheishuo.app.R;
 import com.sheishuo.app.common.util.net.INet;
 import com.sheishuo.app.common.util.net.NetImpl;
+import com.sheishuo.app.common.views.BaseToolbar;
 import com.sheishuo.app.impl.SheishuoUI;
 
 /**
@@ -70,6 +71,16 @@ public class ComplaintActivity extends SheishuoUI implements RadioGroup.OnChecke
 
 
     void init(){
+
+        BaseToolbar toolbar = findView(R.id.toolbar);
+        toolbar.setTitle("投诉");
+        toolbar.setBackOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                finish();
+            }
+        });
+
         radioGroup.setOnCheckedChangeListener(this);
         submitBtn.setOnClickListener(new View.OnClickListener() {
             @Override
@@ -86,8 +97,6 @@ public class ComplaintActivity extends SheishuoUI implements RadioGroup.OnChecke
                     showToast(context,"提交投诉成功");
                     finish();
                 }
-
-
             }
         });
     }

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

@@ -2,10 +2,13 @@ package com.sheishuo.app.core_module.mine.view.ui.activity;
 
 import android.content.Context;
 import android.content.Intent;
+import android.graphics.Color;
 import android.os.Bundle;
+import android.text.TextUtils;
 import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.View;
+import android.view.ViewGroup;
 import android.widget.CheckBox;
 import android.widget.CompoundButton;
 import android.widget.GridLayout;
@@ -13,8 +16,12 @@ import android.widget.LinearLayout;
 import android.widget.RadioButton;
 import android.widget.TextView;
 
+import com.netease.nim.uikit.common.util.sys.ScreenUtil;
 import com.sheishuo.app.R;
+import com.sheishuo.app.cache.AccountCache;
 import com.sheishuo.app.cache.HobbyCache;
+import com.sheishuo.app.cache.SocialInfoCache;
+import com.sheishuo.app.common.beans.SocialInfoBean;
 import com.sheishuo.app.common.util.net.INet;
 import com.sheishuo.app.common.util.net.NetImpl;
 import com.sheishuo.app.common.util.net.ResponseCallback;
@@ -23,6 +30,7 @@ import com.sheishuo.app.impl.SheishuoUI;
 
 import org.w3c.dom.Text;
 
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -44,7 +52,8 @@ public class HobbySelectActivity extends SheishuoUI {
     private INet net = new NetImpl();
 
     //FLAGS
-    private String hobbySelect = "";
+//    private String hobbySelect = "";
+    private List<String> hobbySelectList = new ArrayList<String>();
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
@@ -61,12 +70,21 @@ public class HobbySelectActivity extends SheishuoUI {
 
     void init(){
 
+        toolbar.setTitle("兴趣爱好");
+        toolbar.setBackOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                finish();
+            }
+        });
+
         TextView rightTxt = new TextView(getBaseContext());
-        rightTxt.setText("HobbySelectActivity");
+        rightTxt.setText("保存");
         rightTxt.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
                 Intent intent = new Intent();
+                String hobbySelect = TextUtils.join(",", hobbySelectList);
                 intent.putExtra(RESULT_HOBBY,hobbySelect.substring(0,hobbySelect.length() - 1));
                 setResult(HOBBY_RESULT_CODE,intent);
                 finish();
@@ -102,28 +120,30 @@ public class HobbySelectActivity extends SheishuoUI {
             @Override
             public void run() {
                 try {
+
+                    SocialInfoBean bean = SocialInfoCache.get(AccountCache.getAccount().getId());
+                    String [] hobbyArr = bean.getHobby().split(",");
+
+                    int width = (ScreenUtil.screenWidth - ScreenUtil.dip2px(5) * 6 - ScreenUtil.dip2px(15) * 2) / 3;
                     List<String> categoryList = HobbyCache.getHobbyCategory();
 
                     for (String category : categoryList){
                         Log.e(TAG,category);
                         LinearLayout linearLayout = new LinearLayout(context);
+                        LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
+                        linearLayout.setLayoutParams(layoutParams);
+
                         TextView textView = new TextView(context);
                         GridLayout gridLayout = new GridLayout(context);
-                        gridLayout.setColumnCount(5);
+                        ViewGroup.LayoutParams gridLayoutParams = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
+                        gridLayout.setLayoutParams(gridLayoutParams);
+                        gridLayout.setColumnCount(3);
                         textView.setText(category);
                         hobbyLayout.addView(textView);
                         linearLayout.addView(gridLayout);
 
                         for (String item : HobbyCache.getHobbyItems(category)){
-                            final CheckBox checkBox = (CheckBox) LayoutInflater.from(context).inflate(R.layout.item_hobby_select_checkbox,null);
-                            checkBox.setText(item);
-                            checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
-                                @Override
-                                public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
-                                    if (isChecked) hobbySelect += checkBox.getText().toString()+ ",";
-                                }
-                            });
-                            gridLayout.addView(checkBox);
+                            addHobbyItem(item, width, gridLayout, hobbyArr);
                         }
 
                         hobbyLayout.addView(linearLayout);
@@ -135,4 +155,52 @@ public class HobbySelectActivity extends SheishuoUI {
             }
         });
     }
+
+    private void addHobbyItem(String item, int width, GridLayout gridLayout, String[] selectedHobbyArr)
+    {
+        final CheckBox checkBox = (CheckBox) LayoutInflater.from(context).inflate(R.layout.item_hobby_select_checkbox, null);
+
+        ViewGroup.MarginLayoutParams marginLayoutParams = new ViewGroup.MarginLayoutParams(width, ViewGroup.LayoutParams.WRAP_CONTENT);
+        marginLayoutParams.setMargins(ScreenUtil.dip2px(5), ScreenUtil.dip2px(2), ScreenUtil.dip2px(5), ScreenUtil.dip2px(2));
+        GridLayout.LayoutParams checkBoxLayoutParams = new GridLayout.LayoutParams(marginLayoutParams);
+        checkBox.setLayoutParams(checkBoxLayoutParams);
+        checkBox.setText(item);
+
+        for(String hobby : selectedHobbyArr)
+        {
+            if(hobby.equals(item)) {
+                checkBox.setChecked(true);
+                checkBox.setTextColor(Color.WHITE);
+                addHobby(hobby);
+            }
+        }
+
+        checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
+            @Override
+            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+                checkBox.setTextColor(isChecked ? Color.WHITE : Color.BLACK);
+//                                    if (isChecked) hobbySelect += checkBox.getText().toString()+ ",";
+                if(isChecked)
+                {
+                    addHobby(checkBox.getText().toString());
+                }
+                else
+                {
+                    removeHobby(checkBox.getText().toString());
+                }
+            }
+        });
+        gridLayout.addView(checkBox);
+    }
+
+    private void addHobby(String hobby)
+    {
+        if(!hobbySelectList.contains(hobby))
+            hobbySelectList.add(hobby);
+    }
+
+    private void removeHobby(String hobby)
+    {
+        hobbySelectList.remove(hobby);
+    }
 }

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

@@ -1,21 +1,31 @@
 package com.sheishuo.app.core_module.mine.view.ui.activity;
 
 import android.content.Context;
+import android.content.Intent;
 import android.os.Bundle;
 import android.support.design.widget.TabLayout;
 import android.support.v4.view.ViewPager;
 import android.support.v7.widget.LinearLayoutManager;
 import android.support.v7.widget.RecyclerView;
+import android.util.Log;
 import android.view.View;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
 
 import com.sheishuo.app.R;
+import com.sheishuo.app.cache.AccountCache;
 import com.sheishuo.app.common.beans.TradeBean;
 import com.sheishuo.app.common.util.net.INet;
 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.trade.model.TradeModel;
+import com.sheishuo.app.core_module.trade.presenter.TradePresenter;
 import com.sheishuo.app.core_module.trade.view.adapter.TradeItemAdapter;
+import com.sheishuo.app.core_module.trade.view.ui.activity.TradeChangePriorityActivity;
+import com.sheishuo.app.core_module.trade.view.ui.activity.TradeDetailsActivity;
+import com.sheishuo.app.core_module.trade.view.ui.activity.TradeSearchActivity;
 import com.sheishuo.app.impl.SheishuoUI;
 
 /**
@@ -25,6 +35,7 @@ import com.sheishuo.app.impl.SheishuoUI;
 public class MineTradeActivity extends SheishuoUI {
 
     private String TAG = this.getClass().getSimpleName();
+    private TradePresenter presenter;
     private Context context = this;
 
     private BaseToolbar toolbar;
@@ -43,10 +54,14 @@ public class MineTradeActivity extends SheishuoUI {
 
     private INet net = new NetImpl();
 
+    public TextView priorityTV = null;
+    public String priorityBeanId;
+
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.mine_trade);
+        presenter = new TradePresenter(this);
         findViews();
         init();
     }
@@ -108,7 +123,17 @@ public class MineTradeActivity extends SheishuoUI {
         });
     }
 
-
+    @Override
+    public void onActivityResult(int requestCode, int resultCode, Intent data) {
+        super.onActivityResult(requestCode, resultCode, data);
+        if (TradeChangePriorityActivity.TRADE_CHANGE_PRIORITY == resultCode){
+            Log.e(TAG,"收到置顶修改请求");
+            Bundle bundle = data.getExtras();
+            String priority = bundle.getString(TradeChangePriorityActivity.TRADE_PRIORITY);
+            String priorityType = bundle.getString(TradeChangePriorityActivity.TRADE_PRIORITY_TYPE);
+            presenter.updatePriority(priorityBeanId, priority);
+        }
+    }
 
     public void getTradeList(int type,int page){
         net.getTradeList(type, page, new ResponseCallback() {
@@ -121,6 +146,7 @@ public class MineTradeActivity extends SheishuoUI {
                         if (adapter == null){
                             adapter = new TradeItemAdapter(MineTradeActivity.this,bean);
                             recyclerView.setAdapter(adapter);
+                            setupAdapter();
                         }else {
                             adapter.addAll(bean);
                         }
@@ -137,5 +163,64 @@ public class MineTradeActivity extends SheishuoUI {
         });
     }
 
+    private void setupAdapter(){
+        if (adapter != null){
+            adapter.setOnTradeItemClickListener(new TradeItemAdapter.OnTradeItemClickListener() {
+                @Override
+                public void onClick(View view) {
+                    if (view instanceof LinearLayout){
+                        TradeBean.DBean.ListBean bean = (TradeBean.DBean.ListBean) view.getTag();
+                        Intent intent = new Intent(MineTradeActivity.this, TradeDetailsActivity.class);
+                        intent.putExtra(TradeDetailsActivity.DATA, bean);
+                        startActivity(intent);
+                    }
+                    else if(view.getId() == R.id.trade_list_item_avatar || view.getId() == R.id.trade_list_item_name)
+                    {
+                        UserInfoDetailActivity.start(MineTradeActivity.this, (String) view.getTag(R.id.user_account));
+                    }
+                    else if (view instanceof ImageView){
+
+                        String id;
+                        if ((id = (String) view.getTag(R.drawable.trade_unfollowed)) != null){
+                            Log.e("ID","点击之前未关注");
+                            //presenter.followTrade(id);
+                        }else if ((id = (String) view.getTag(R.drawable.trade_followed)) != null){
+                            Log.e("ID","点击之前已关注关注");
+                            //presenter.unfollowTrade(id);
+                        }
 
+                    }else if (view instanceof TextView){
+                        priorityTV = (TextView) view;
+                        priorityBeanId = (String) view.getTag(R.id.flag_trade_id);
+                        String userId = (String) view.getTag(R.id.user_account);
+                        if(userId.equals(AccountCache.getAccount().getId())) {
+                            String priority = (String) view.getTag(R.id.flag_trade_priority);
+                            String priorityType = (String) view.getTag(R.id.flag_trade_priority_type);
+                            Intent intent = new Intent(MineTradeActivity.this, TradeChangePriorityActivity.class);
+                            Bundle data = new Bundle();
+                            data.putString(TradeChangePriorityActivity.TRADE_PRIORITY, priority);
+                            data.putString(TradeChangePriorityActivity.TRADE_PRIORITY_TYPE, priorityType);
+                            intent.putExtras(data);
+                            startActivityForResult(intent, TradeChangePriorityActivity.TRADE_CHANGE_PRIORITY);
+                        }
+                    }else {
+                        Log.e(TAG,"未识别View");
+                    }
+
+                }
+            });
+        }
+    }
+
+    public void onPriorityUpdate(final String tradeId, final String priority)
+    {
+        getHandler().postDelayed(new Runnable() {
+            @Override
+            public void run() {
+                if(adapter != null)
+                    adapter.updateTradePriority(tradeId, priority);
+            }
+        }, 100);
+
+    }
 }

+ 84 - 26
app/src/com/sheishuo/app/core_module/mine/view/ui/activity/PersonalSettingsActivity.java

@@ -125,6 +125,14 @@ public class PersonalSettingsActivity extends SheishuoUI {
 
     void init() {
 
+        toolbar.setTitle("设置");
+        toolbar.setBackOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                finish();
+            }
+        });
+
         //初始化回调
         callback = new ResponseCallback() {
             @Override
@@ -180,33 +188,25 @@ public class PersonalSettingsActivity extends SheishuoUI {
 
         if (!bean.getAge().isEmpty()) ageTV.setText(bean.getAge());
 
-        if (!bean.getHobby().isEmpty()) hobbyTV.setText(bean.getHobby().substring(0, 6));
+        if (!bean.getHobby().isEmpty())
+        {
+            if(bean.getHobby().length() > 6)
+                hobbyTV.setText(bean.getHobby().substring(0, 6));
+            else
+                hobbyTV.setText(bean.getHobby());
+        }
+        else
+        {
+            hobbyTV.setText("");
+        }
 
 
         //隐藏真实姓名
-        if (!bean.getReal_name().isEmpty()){
-            String realName = bean.getReal_name();
-            String hideRealName = "";
-            for (int i = 0;i < realName.length() - 1;i++){
-                hideRealName += "*";
-            }
-            realName = hideRealName + realName.charAt(realName.length() - 1);
-            realNameTV.setText(realName);
-        }
+        updateRealName();
 
-        //隐藏身份证号
-        if (!bean.getId_number().isEmpty()){
-            String idNum = bean.getId_number();
-            String hideIdNum = "";
-            if (idNum.length() > 4) {
-                for (int i = 0;i < idNum.length() - 4;i++){
-                    hideIdNum += "*";
-                }
-                idNum = hideIdNum + idNum.substring(idNum.length() - 4,idNum.length());
-                idNumTV.setText(idNum);
-            }
 
-        }
+        //隐藏身份证号
+        updateIdNumber();
 
 
         //公开年龄Switch监听
@@ -303,6 +303,41 @@ public class PersonalSettingsActivity extends SheishuoUI {
 
     }
 
+    private void updateRealName()
+    {
+        if (!bean.getReal_name().isEmpty()){
+            String realName = bean.getReal_name();
+            String hideRealName = "";
+            for (int i = 0;i < realName.length() - 1;i++){
+                hideRealName += "*";
+            }
+            realName = hideRealName + realName.charAt(realName.length() - 1);
+            realNameTV.setText(realName);
+        }
+        else
+        {
+            realNameTV.setText("请输入真实姓名");
+        }
+    }
+
+    private void updateIdNumber()
+    {
+        if (!bean.getId_number().isEmpty()){
+            String idNum = bean.getId_number();
+            String hideIdNum = "";
+            if (idNum.length() > 4) {
+                for (int i = 0;i < idNum.length() - 4;i++){
+                    hideIdNum += "*";
+                }
+                idNum = hideIdNum + idNum.substring(idNum.length() - 4,idNum.length());
+                idNumTV.setText(idNum);
+            }
+        }
+        else
+        {
+            idNumTV.setText("请输入身份证号码");
+        }
+    }
 
     @Override
     protected void onActivityResult(int requestCode, int resultCode, Intent data) {
@@ -327,11 +362,13 @@ public class PersonalSettingsActivity extends SheishuoUI {
                     realNameTV.setText(resultStr);
                     bean.setReal_name(resultStr);
                     net.updateSocialInfo(bean, callback);
+                    updateRealName();
                     break;
                 case REQUEST_IDNUM:
                     idNumTV.setText(resultStr);
                     bean.setId_number(resultStr);
                     net.updateSocialInfo(bean, callback);
+                    updateIdNumber();
                     break;
             }
         } else if (resultCode == LOCATION_SELECTED_RESULT_CODE) {
@@ -348,6 +385,18 @@ public class PersonalSettingsActivity extends SheishuoUI {
         } else if (HobbySelectActivity.HOBBY_RESULT_CODE == resultCode) {
             String hobby = data.getStringExtra(HobbySelectActivity.RESULT_HOBBY);
             hobbyTV.setText(hobby);
+            bean.setHobby(hobby);
+
+            net.updateSocialInfo(bean, new ResponseCallback() {
+                @Override
+                public void onSuccess(Object object) {
+                }
+
+                @Override
+                public void onFailed() {
+                    showToast(context,"更新兴趣失败,请重试");
+                }
+            });
         }
     }
 
@@ -355,12 +404,17 @@ public class PersonalSettingsActivity extends SheishuoUI {
     private void selectGender(final UserService userService) {
         final int[] yourChoice = new int[1];
         final String[] items = {"保密", "男", "女"};
-        yourChoice[0] = -1;
+        for(int i=0; i<items.length; i++)
+        {
+            if(genderTV.getText().equals(items[i]))
+                yourChoice[0] = i;
+        }
+
         AlertDialog.Builder singleChoiceDialog =
                 new AlertDialog.Builder(context);
         singleChoiceDialog.setTitle("请选择性别");
         // 第二个参数是默认选项,此处设置为0
-        singleChoiceDialog.setSingleChoiceItems(items, 0,
+        singleChoiceDialog.setSingleChoiceItems(items, yourChoice[0],
                 new DialogInterface.OnClickListener() {
                     @Override
                     public void onClick(DialogInterface dialog, int which) {
@@ -373,9 +427,13 @@ public class PersonalSettingsActivity extends SheishuoUI {
                     public void onClick(DialogInterface dialog, int which) {
                         if (yourChoice[0] != -1) {
                             Map<UserInfoFieldEnum,Object> fieldMap = new HashMap<>();
-                            fieldMap.put(UserInfoFieldEnum.GENDER,yourChoice[0]);
+                            fieldMap.put(UserInfoFieldEnum.GENDER, yourChoice[0]);
                             userService.updateUserInfo(fieldMap);
-                            init();
+                            genderTV.setText(items[yourChoice[0]]);
+                        }
+                        else
+                        {
+
                         }
                     }
                 });

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

@@ -49,7 +49,7 @@ public class UserInfoDetailActivity extends SheishuoUI {
 
     private HeadImageView avatar;
 
-    private ImageView settingImg;
+    private ImageView settingImg, backImg;
 
     private TextView nameTV, idTV, ageTV, hobbyTV, locationTV;
 
@@ -91,6 +91,7 @@ public class UserInfoDetailActivity extends SheishuoUI {
     void findViews() {
         avatar = findView(R.id.user_info_details_avatar);
         settingImg = findView(R.id.user_info_details_setting);
+        backImg = findView(R.id.back_icon);
 
         nameTV = findView(R.id.user_info_details_name);
         idTV = findView(R.id.user_info_details_id);
@@ -143,6 +144,12 @@ public class UserInfoDetailActivity extends SheishuoUI {
             }
         });
 
+        backImg.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                finish();
+            }
+        });
 
 
 

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

@@ -64,6 +64,14 @@ public class UserInfoSettingActivity extends SheishuoUI {
 
     void init(){
 
+        toolbar.setTitle("设置");
+        toolbar.setBackOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                finish();
+            }
+        });
+
         //MuteSwitch
         if (NIMClient.getService(FriendService.class).isNeedMessageNotify(userId)){
             muteSwitch.setChecked(true);

+ 7 - 0
app/src/com/sheishuo/app/core_module/sheishuo/view/ui/SettingTextEditActivity.java

@@ -48,6 +48,13 @@ public class SettingTextEditActivity extends SheishuoUI {
 
     void init(){
         toolbar.setTitle(title);
+        toolbar.setBackOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                finish();
+            }
+        });
+
         editText.setText(originStr);
 
         //临时特殊处理一下仅能输入数字

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

@@ -205,4 +205,43 @@ public class TradeModel {
         }
 
     }
+
+    public void editTrade(final String id, final String priority)
+    {
+        final FormBody body = new FormBody.Builder()
+                .add("id", id)
+                .add("priority", ""+priority)
+                .build();
+
+        new Thread(new Runnable() {
+            @Override
+            public void run() {
+                net.post(NetInfo.TRADE_EDIT, body, new ResponseCallback() {
+                    @Override
+                    public void onSuccess(Object object) {
+                        String json = (String)object;
+                        try{
+                            JSONObject resObj = new JSONObject(json);
+                            JSONObject data = resObj.getJSONObject("d");
+                            int coin = data.getInt("coin");
+                            AccountCache.getAccount().setCoin(""+coin);
+
+                            int tradeId = data.getInt("id");
+                            int priority = data.getInt("priority");
+                            presenter.onPriorityUpdate(""+tradeId, ""+priority);
+                        }
+                        catch (Exception e)
+                        {
+                            Log.e("parse trade edit result", e.getMessage());
+                        }
+                    }
+
+                    @Override
+                    public void onFailed() {
+                        presenter.showToast("加载失败,请检查网络");
+                    }
+                });
+            }
+        }).start();
+    }
 }

+ 28 - 0
app/src/com/sheishuo/app/core_module/trade/presenter/TradePresenter.java

@@ -1,7 +1,9 @@
 package com.sheishuo.app.core_module.trade.presenter;
 
 import com.sheishuo.app.common.beans.TradeBean;
+import com.sheishuo.app.core_module.mine.view.ui.activity.MineTradeActivity;
 import com.sheishuo.app.core_module.trade.model.TradeModel;
+import com.sheishuo.app.core_module.trade.view.ui.activity.TradeDetailsActivity;
 import com.sheishuo.app.core_module.trade.view.ui.activity.TradePublishActivity;
 import com.sheishuo.app.main.fragment.TradeListFragment;
 
@@ -15,6 +17,8 @@ import java.util.List;
 public class TradePresenter {
     TradeListFragment fragment;
     TradePublishActivity activity;
+    TradeDetailsActivity detailsActivity;
+    MineTradeActivity mineTradeActivity;
     TradeModel model;
 
     public TradePresenter(TradeListFragment fragment){
@@ -27,6 +31,16 @@ public class TradePresenter {
         model = new TradeModel(this);
     }
 
+    public TradePresenter(TradeDetailsActivity activity){
+        this.detailsActivity = activity;
+        model = new TradeModel(this);
+    }
+
+    public TradePresenter(MineTradeActivity activity){
+        this.mineTradeActivity = activity;
+        model = new TradeModel(this);
+    }
+
 
     public void loadTradeList(int type,int page){
         model.loadTradeList(type,page);
@@ -75,4 +89,18 @@ public class TradePresenter {
     public void onAllPhotoUploaded(){
         activity.onAllPhotosUploaded();
     }
+
+
+
+    public void updatePriority(String tradeId, String priority)
+    {
+        model.editTrade(tradeId, priority);
+    }
+
+    public void onPriorityUpdate(String tradeId, String priority)
+    {
+        if(detailsActivity != null) detailsActivity.onPriorityUpdate(tradeId, priority);
+        if(mineTradeActivity != null) mineTradeActivity.onPriorityUpdate(tradeId, priority);
+        if(fragment != null) fragment.onPriorityUpdate(tradeId, priority);
+    }
 }

+ 12 - 3
app/src/com/sheishuo/app/core_module/trade/view/adapter/TradeItemAdapter.java

@@ -83,9 +83,14 @@ public class TradeItemAdapter extends RecyclerView.Adapter<TradeItemAdapter.Trad
         if (IS_IN_MINE_INFO) holder.followImg.setVisibility(View.GONE);
 
         //加载用户头像
+        Glide.clear(holder.avatarImg);
+        holder.avatarImg.setTag(R.id.user_account, bean.getUser_id());
+
         String avatarUrl = NIMClient.getService(UserService.class).getUserInfo(bean.getUser_id()).getAvatar();
         if (avatarUrl != null)
             Glide.with(context).load(avatarUrl).into(holder.avatarImg);
+        holder.avatarImg.setOnClickListener(this);
+
 
         //设置交易帖内容和地区标注
         holder.content.setText(bean.getMsg());
@@ -110,6 +115,9 @@ public class TradeItemAdapter extends RecyclerView.Adapter<TradeItemAdapter.Trad
 
 
         holder.userName.setText(getUserName(bean.getUser_id()));
+        holder.userName.setOnClickListener(this);
+        holder.userName.setTag(R.id.user_account, bean.getUser_id());
+
         holder.date.setText(bean.getInputtime());
 
 
@@ -127,6 +135,7 @@ public class TradeItemAdapter extends RecyclerView.Adapter<TradeItemAdapter.Trad
             holder.priority.setTag(R.id.flag_trade_priority_type, bean.getPriority_type());
             holder.priority.setOnClickListener(this);
         }
+        holder.priority.setTag(R.id.user_account, bean.getUser_id());
 
 
         //判断是否已加关注
@@ -275,14 +284,14 @@ public class TradeItemAdapter extends RecyclerView.Adapter<TradeItemAdapter.Trad
 
     public void updateTradePriority(String id, String priority) {
         Log.e("adapter", "收到置顶修改请求");
-        Log.e("adapter", id + "   " + priority);
         for (TradeBean.DBean.ListBean bean : data) {
             if (bean.getId().equals(id)) {
                 bean.setPriority(priority);
+                Log.e("adapter", id + "   " + priority);
+                notifyDataSetChanged();
+                break;
             }
         }
-
-        notifyDataSetChanged();
     }
 
     class TradeItemViewHolder extends RecyclerView.ViewHolder {

+ 61 - 0
app/src/com/sheishuo/app/core_module/trade/view/popup/TradeSortPopupWindow.java

@@ -0,0 +1,61 @@
+package com.sheishuo.app.core_module.trade.view.popup;
+
+import android.app.Activity;
+import android.content.Context;
+import android.support.annotation.IdRes;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.PopupWindow;
+import android.widget.RadioGroup;
+
+import com.netease.nim.uikit.common.util.sys.ScreenUtil;
+import com.sheishuo.app.R;
+
+/**
+ * Created by fenix on 2017/9/6.
+ */
+
+public class TradeSortPopupWindow extends PopupWindow {
+
+    private Activity context;
+    private RadioGroup radioGroup;
+
+    public TradeSortPopupWindow(final Activity context) {
+        this.context = context;
+
+        //获得 LayoutInflater 的实例
+        LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+        View view = inflater.inflate(R.layout.trade_popup, null);
+        radioGroup = (RadioGroup) view.findViewById(R.id.trade_sort_group);
+
+        this.setContentView(view);
+        this.setWidth(ViewGroup.LayoutParams.WRAP_CONTENT);
+        this.setHeight(ViewGroup.LayoutParams.WRAP_CONTENT);
+        this.setFocusable(true);
+        this.setOutsideTouchable(true);
+        this.update();
+    }
+
+    public void setOnCheckedChangeListener(RadioGroup.OnCheckedChangeListener listener)
+    {
+        radioGroup.setOnCheckedChangeListener(listener);
+    }
+
+    public void showPopupWindow(View parent, int index) {
+        if (!this.isShowing()) {
+            // 以下拉方式显示popupwindow
+            radioGroup.check(index);
+            this.showAsDropDown(parent, parent.getLayoutParams().width / 2, ScreenUtil.dip2px(10));
+        }
+    }
+
+    @Override
+    public void dismiss()
+    {
+        super.dismiss();
+        radioGroup.setOnCheckedChangeListener(null);
+    }
+
+
+}

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

@@ -5,6 +5,7 @@ import android.content.Context;
 import android.os.Bundle;
 import android.view.View;
 import android.widget.ImageView;
+import android.widget.TextView;
 
 import com.sheishuo.app.R;
 import com.sheishuo.app.cache.AccountCache;
@@ -13,6 +14,7 @@ import com.sheishuo.app.common.util.net.NetImpl;
 import com.sheishuo.app.common.util.net.ResponseCallback;
 import com.sheishuo.app.common.util.pay.PayUtil;
 import com.sheishuo.app.common.util.pay.PaymentListener;
+import com.sheishuo.app.common.views.BaseToolbar;
 import com.sheishuo.app.impl.SheishuoUI;
 
 /**
@@ -27,7 +29,7 @@ public class PayMethodActivity extends SheishuoUI implements PaymentListener{
     private String TAG = this.getClass().getSimpleName();
     private Context context = this;
 
-
+    private TextView moneyTxt;
     private ImageView wechatImg,alipayImg;
 
     private int money;
@@ -45,12 +47,25 @@ public class PayMethodActivity extends SheishuoUI implements PaymentListener{
     }
 
     void findViews(){
+        moneyTxt = findView(R.id.recharge_money);
         wechatImg = findView(R.id.trade_pay_method_wechat_img);
         alipayImg = findView(R.id.trade_pay_method_alipay_img);
     }
 
 
     void init(){
+
+        BaseToolbar toolbar = findView(R.id.toolbar);
+        toolbar.setTitle("谁说收银台");
+        toolbar.setBackOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                finish();
+            }
+        });
+
+        moneyTxt.setText(""+money+"元");
+
         pay.init(context,PayMethodActivity.this);
 
         alipayImg.setOnClickListener(new View.OnClickListener() {
@@ -70,6 +85,13 @@ public class PayMethodActivity extends SheishuoUI implements PaymentListener{
             }
         });
 
+        wechatImg.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                showToast(context,"功能暂未开放");
+            }
+        });
+
     }
 
     @Override

+ 45 - 11
app/src/com/sheishuo/app/core_module/trade/view/ui/activity/RechargeActivity.java

@@ -6,10 +6,14 @@ import android.os.Bundle;
 import android.support.annotation.IdRes;
 import android.view.View;
 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.views.MutipleRadioGroup;
 import com.sheishuo.app.R;
+import com.sheishuo.app.common.views.BaseToolbar;
 import com.sheishuo.app.impl.SheishuoUI;
 
 /**
@@ -21,9 +25,9 @@ public class RechargeActivity extends SheishuoUI {
     private String TAG = this.getClass().getSimpleName();
     private Context context = this;
 
-    private MutipleRadioGroup radioGroup;
+    private GridLayout itemGrid;
 
-    private RadioButton rb1, rb2, rb3, rb4, rb5, rb6, rb7;
+    private int[] moneys = new int[]{20, 30, 50, 100, 200, 300};
 
     private Button submitBtn;
 
@@ -39,24 +43,23 @@ public class RechargeActivity extends SheishuoUI {
 
 
     void findViews() {
-        radioGroup = findView(R.id.trade_recharge_radiogroup);
+        itemGrid = findView(R.id.recharge_grid);
         submitBtn = findView(R.id.trade_recharge_btn);
     }
 
 
     void init() {
-        radioGroup.setOnCheckedChangeListener(new MutipleRadioGroup.OnCheckedChangeListener() {
-            @Override
-            public void onCheckedChanged(MutipleRadioGroup group, @IdRes int checkedId) {
-                String text = ((RadioButton) findView(checkedId)).getText().toString();
-                if (text.contains("元")){
-                    money = Integer.valueOf(text.replace("元",""));
 
-                }
+        BaseToolbar toolbar = findView(R.id.toolbar);
+        toolbar.setTitle("充值");
+        toolbar.setBackOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                finish();
             }
         });
 
-
+        initRechargeItems();
 
         submitBtn.setOnClickListener(new View.OnClickListener() {
             @Override
@@ -73,6 +76,37 @@ public class RechargeActivity extends SheishuoUI {
         });
     }
 
+    void initRechargeItems()
+    {
+        for(int i=0; i<itemGrid.getChildCount(); i++)
+        {
+            LinearLayout item = (LinearLayout) itemGrid.getChildAt(i);
+            handleRechargeItem(i, item);
+        }
+    }
+
+    private void handleRechargeItem(final int index, final LinearLayout item)
+    {
+        item.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                for(int i=0; i<itemGrid.getChildCount(); i++)
+                {
+                    LinearLayout child = (LinearLayout) itemGrid.getChildAt(i);
+                    if(child.equals(item))
+                    {
+                        child.setBackgroundResource(R.drawable.ico_recharge_checked);
+                    }
+                    else
+                    {
+                        child.setBackgroundResource(R.drawable.ico_recharge_unchecked);
+                    }
+                }
+                money = moneys[index];
+            }
+        });
+    }
+
 
 
 }

+ 7 - 1
app/src/com/sheishuo/app/core_module/trade/view/ui/activity/TradeChangePriorityActivity.java

@@ -47,6 +47,12 @@ public class TradeChangePriorityActivity extends SheishuoUI {
     void init(){
 
         toolbar.setTitle("修改置顶");
+        toolbar.setBackOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                finish();
+            }
+        });
 
         TextView rightTxt = new TextView(getBaseContext());
         rightTxt.setText("确定");
@@ -55,7 +61,7 @@ public class TradeChangePriorityActivity extends SheishuoUI {
             public void onClick(View v) {
                 Intent intent = new Intent();
                 Bundle data = new Bundle();
-                data.putString(TRADE_PRIORITY,nowPriority);
+                data.putString(TRADE_PRIORITY, ""+(Integer.valueOf(nowPriority)-Integer.valueOf(priority)));
                 data.putString(TRADE_PRIORITY_TYPE,priorityType);
                 intent.putExtras(data);
                 setResult(TRADE_CHANGE_PRIORITY,intent);

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

@@ -1,6 +1,7 @@
 package com.sheishuo.app.core_module.trade.view.ui.activity;
 
 import android.content.Context;
+import android.content.Intent;
 import android.os.Bundle;
 import android.util.Log;
 import android.view.View;
@@ -16,10 +17,14 @@ import com.netease.nimlib.sdk.NIMClient;
 import com.netease.nimlib.sdk.msg.model.IMMessage;
 import com.netease.nimlib.sdk.uinfo.UserService;
 import com.sheishuo.app.R;
+import com.sheishuo.app.cache.AccountCache;
 import com.sheishuo.app.common.beans.TradeBean;
 import com.sheishuo.app.common.util.img.ImgUtil;
 import com.sheishuo.app.common.views.BaseToolbar;
 import com.sheishuo.app.common.views.PartlyHighLightTextView;
+import com.sheishuo.app.core_module.mine.view.ui.activity.MineTradeActivity;
+import com.sheishuo.app.core_module.mine.view.ui.activity.UserInfoDetailActivity;
+import com.sheishuo.app.core_module.trade.presenter.TradePresenter;
 import com.sheishuo.app.impl.SheishuoUI;
 
 /**
@@ -33,6 +38,7 @@ public class TradeDetailsActivity extends SheishuoUI {
 
     private String TAG = this.getClass().getSimpleName();
     private Context context = this;
+    private TradePresenter presenter;
 
     private TradeBean.DBean.ListBean bean;
 
@@ -63,6 +69,7 @@ public class TradeDetailsActivity extends SheishuoUI {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.trade_details);
         bean = (TradeBean.DBean.ListBean) getIntent().getSerializableExtra(DATA);
+        presenter = new TradePresenter(this);
         findViews();
         init();
     }
@@ -70,7 +77,6 @@ public class TradeDetailsActivity extends SheishuoUI {
 
     void findViews(){
         toolbar = findView(R.id.toolbar);
-
         avatar = findView(R.id.trade_details_avatar);
 
         nickNameTV = findView(R.id.trade_details_name);
@@ -89,6 +95,13 @@ public class TradeDetailsActivity extends SheishuoUI {
 
     void init(){
 
+        toolbar.setTitle("详情");
+        toolbar.setBackOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                finish();
+            }
+        });
 
         if (getUserInfo(bean.getUser_id()).getAvatar() != null){
             Glide.with(context)
@@ -96,12 +109,32 @@ public class TradeDetailsActivity extends SheishuoUI {
                             .getAvatar()).into(avatar);
         }
 
+        avatar.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                showUserInfo();
+            }
+        });
 
         nickNameTV.setText(getName(bean.getUser_id()));
+        nickNameTV.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                showUserInfo();
+            }
+        });
+
         locationTV.setText(bean.getDistrict());
         dateTV.setText(bean.getInputtime());
         if (bean.getPriority().equals("0")) priorityTV.setVisibility(View.INVISIBLE);
         priorityTV.setText("置顶x" + bean.getPriority());
+        priorityTV.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                showPriorityChangeActivity();
+            }
+        });
+
         readNumTV.setText("阅读量" + bean.getReview());
 
         contentTV.setText(bean.getMsg());
@@ -131,4 +164,39 @@ public class TradeDetailsActivity extends SheishuoUI {
         }
     }
 
+    private void showUserInfo()
+    {
+        UserInfoDetailActivity.start(TradeDetailsActivity.this, bean.getUser_id());
+    }
+
+    private void showPriorityChangeActivity()
+    {
+        if(bean.getUser_id().equals(AccountCache.getAccount().getId()))
+        {
+            Intent intent = new Intent(TradeDetailsActivity.this, TradeChangePriorityActivity.class);
+            Bundle data = new Bundle();
+            data.putString(TradeChangePriorityActivity.TRADE_PRIORITY, bean.getPriority());
+            data.putString(TradeChangePriorityActivity.TRADE_PRIORITY_TYPE, bean.getPriority_type());
+            intent.putExtras(data);
+            startActivityForResult(intent, TradeChangePriorityActivity.TRADE_CHANGE_PRIORITY);
+        }
+    }
+
+    @Override
+    public void onActivityResult(int requestCode, int resultCode, Intent data) {
+        super.onActivityResult(requestCode, resultCode, data);
+        if (TradeChangePriorityActivity.TRADE_CHANGE_PRIORITY == resultCode){
+            Log.e(TAG,"收到置顶修改请求");
+            Bundle bundle = data.getExtras();
+            String priority = bundle.getString(TradeChangePriorityActivity.TRADE_PRIORITY);
+            String priorityType = bundle.getString(TradeChangePriorityActivity.TRADE_PRIORITY_TYPE);
+            presenter.updatePriority(bean.getId(), priority);
+        }
+    }
+
+    public void onPriorityUpdate(String tradeId, String priority)
+    {
+        bean.setPriority(priority);
+        priorityTV.setText("置顶x" + bean.getPriority());
+    }
 }

+ 102 - 0
app/src/com/sheishuo/app/login/LoginActivity.java

@@ -4,18 +4,28 @@ import android.content.Context;
 import android.content.Intent;
 import android.os.Bundle;
 import android.os.Handler;
+import android.os.IBinder;
 import android.util.Log;
+import android.view.MotionEvent;
 import android.view.View;
+import android.view.inputmethod.InputMethodManager;
 import android.widget.Button;
+import android.widget.CompoundButton;
 import android.widget.EditText;
+import android.widget.RadioButton;
+import android.widget.TextView;
 import android.widget.Toast;
 
+import com.netease.nim.uikit.common.ui.dialog.EasyAlertDialogHelper;
 import com.sheishuo.app.cache.AccountCache;
 import com.sheishuo.app.R;
 import com.sheishuo.app.common.util.data.SPHelper;
 import com.sheishuo.app.common.util.net.INet;
 import com.sheishuo.app.common.util.net.NetImpl;
+import com.sheishuo.app.common.util.net.NetInfo;
 import com.sheishuo.app.common.util.net.ResponseCallback;
+import com.sheishuo.app.contact.activity.AddFriendActivity;
+import com.sheishuo.app.core_module.mine.view.ui.activity.AboutWebViewActivity;
 import com.sheishuo.app.login.beans.LoginBean;
 import com.sheishuo.app.login.helper.LoginHelper;
 import com.sheishuo.app.impl.SheishuoToolbarOptions;
@@ -33,6 +43,10 @@ public class LoginActivity extends SheishuoUI implements View.OnClickListener{
 
     private EditText telET,pwdET;
     private Button loginBtn;
+    private TextView toRegisterTxt;
+    private TextView toAgreeTxt;
+    private RadioButton agreeRadio;
+    private boolean isAgree = true;
 
     private INet net = new NetImpl();
 
@@ -52,6 +66,7 @@ public class LoginActivity extends SheishuoUI implements View.OnClickListener{
         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();
@@ -68,6 +83,18 @@ public class LoginActivity extends SheishuoUI implements View.OnClickListener{
             case R.id.login_btn:
                 doLogin();
                 break;
+            case R.id.agree_radio:
+                doAgreeCheck();
+                break;
+            case R.id.register_txt:
+                RegisterActivity.start(context);
+                break;
+            case R.id.agree_txt:
+                Intent intent = new Intent(context,AboutWebViewActivity.class);
+                intent.putExtra(AboutWebViewActivity.TITLE,"用户协议");
+                intent.putExtra(AboutWebViewActivity.URL, NetInfo.AGREEMENT_URL);
+                startActivity(intent);
+                break;
         }
     }
 
@@ -76,15 +103,37 @@ public class LoginActivity extends SheishuoUI implements View.OnClickListener{
         telET = findView(R.id.login_tel);
         pwdET = findView(R.id.login_password);
         loginBtn = findView(R.id.login_btn);
+        toRegisterTxt = findView(R.id.register_txt);
+        toAgreeTxt = findView(R.id.agree_txt);
+        agreeRadio = findView(R.id.agree_radio);
+
         loginBtn.setOnClickListener(this);
+        toRegisterTxt.setOnClickListener(this);
+        toAgreeTxt.setOnClickListener(this);
+        agreeRadio.setOnClickListener(this);
     }
 
+
+
     protected <T extends View> T findView(int id){
         return (T)(findViewById(id));
     }
 
+    void doAgreeCheck()
+    {
+        isAgree = !isAgree;
+        agreeRadio.setChecked(isAgree);
+    }
 
     void doLogin(){
+
+        if(!agreeRadio.isChecked())
+        {
+            EasyAlertDialogHelper.showOneButtonDiolag(LoginActivity.this, "提示",
+                    "您需要同意遵守《谁说社交APP服务协议》", "确认", false, null);
+            return;
+        }
+
         Log.e(TAG,"doLogin");
         final String tel = telET.getText().toString().trim();
         final String pwd = pwdET.getText().toString().trim();
@@ -132,4 +181,57 @@ public class LoginActivity extends SheishuoUI implements View.OnClickListener{
         super.onBackPressed();
         LoginAndRegActivity.start(this);
     }
+
+
+    @Override
+    public boolean dispatchTouchEvent(MotionEvent ev) {
+        if (ev.getAction() == MotionEvent.ACTION_DOWN) {
+
+            // 获得当前得到焦点的View,一般情况下就是EditText(特殊情况就是轨迹求或者实体案件会移动焦点)
+            View v = getCurrentFocus();
+
+            if (isShouldHideInput(v, ev)) {
+                hideSoftInput(v.getWindowToken());
+            }
+        }
+        return super.dispatchTouchEvent(ev);
+    }
+
+    /**
+     * 根据EditText所在坐标和用户点击的坐标相对比,来判断是否隐藏键盘,因为当用户点击EditText时没必要隐藏
+     *
+     * @param v
+     * @param event
+     * @return
+     */
+    private boolean isShouldHideInput(View v, MotionEvent event) {
+        if (v != null && (v instanceof EditText)) {
+            int[] l = { 0, 0 };
+            v.getLocationInWindow(l);
+            int left = l[0], top = l[1], bottom = top + v.getHeight(), right = left
+                    + v.getWidth();
+            if (event.getX() > left && event.getX() < right
+                    && event.getY() > top && event.getY() < bottom) {
+                // 点击EditText的事件,忽略它。
+                return false;
+            } else {
+                return true;
+            }
+        }
+        // 如果焦点不是EditText则忽略,这个发生在视图刚绘制完,第一个焦点不在EditView上,和用户用轨迹球选择其他的焦点
+        return false;
+    }
+
+    /**
+     * 多种隐藏软件盘方法的其中一种
+     *
+     * @param token
+     */
+    private void hideSoftInput(IBinder token) {
+        if (token != null) {
+            InputMethodManager im = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
+            im.hideSoftInputFromWindow(token,
+                    InputMethodManager.HIDE_NOT_ALWAYS);
+        }
+    }
 }

+ 86 - 4
app/src/com/sheishuo/app/login/RegisterActivity.java

@@ -4,11 +4,15 @@ import android.content.Context;
 import android.content.Intent;
 import android.os.Bundle;
 import android.os.Handler;
+import android.os.IBinder;
 import android.os.Message;
 import android.support.annotation.Nullable;
+import android.view.MotionEvent;
 import android.view.View;
+import android.view.inputmethod.InputMethodManager;
 import android.widget.Button;
 import android.widget.EditText;
+import android.widget.RadioButton;
 import android.widget.TextView;
 import android.widget.Toast;
 
@@ -18,6 +22,8 @@ import com.sheishuo.app.common.util.net.NetImpl;
 import com.sheishuo.app.common.util.net.NetInfo;
 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.AboutWebViewActivity;
+import com.sheishuo.app.impl.SheishuoToolbarOptions;
 import com.sheishuo.app.impl.SheishuoUI;
 
 import org.json.JSONObject;
@@ -34,7 +40,8 @@ public class RegisterActivity extends SheishuoUI implements View.OnClickListener
     private String TAG = this.getClass().getSimpleName();
     private Context context = this;
     private EditText telET, codeET, pwdET, pwdConfirmET;
-    private TextView getCodeTV;
+    private TextView getCodeTV, agreeTxt;
+    private RadioButton agreeRadioBtn;
     private Button registerBtn;
     private BaseToolbar toolbar;
     private JSONObject code;
@@ -43,7 +50,7 @@ public class RegisterActivity extends SheishuoUI implements View.OnClickListener
     private INet net = new NetImpl();
 
     private int countDown = 60;
-
+    private boolean isAgree = true;
 
     public static void start(Context context) {
         Intent intent = new Intent(context, RegisterActivity.class);
@@ -68,14 +75,23 @@ public class RegisterActivity extends SheishuoUI implements View.OnClickListener
         pwdConfirmET = $(R.id.register_confirm_password);
         getCodeTV = $(R.id.register_get_code);
         registerBtn = $(R.id.register_btn);
-        toolbar = $(R.id.toolbar);
+        agreeTxt = $(R.id.agree_txt);
+        agreeRadioBtn = $(R.id.agree_radio);
     }
 
     private void init() {
-        toolbar.setTitle("注册");
+
+        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);
 
         getCodeTV.setOnClickListener(this);
         registerBtn.setOnClickListener(this);
+        agreeTxt.setOnClickListener(this);
+        agreeRadioBtn.setOnClickListener(this);
 
         handler = new Handler(){
             @Override
@@ -124,6 +140,15 @@ public class RegisterActivity extends SheishuoUI implements View.OnClickListener
             case R.id.register_btn:
                 register();
                 break;
+            case R.id.agree_txt:
+                Intent intent = new Intent(context,AboutWebViewActivity.class);
+                intent.putExtra(AboutWebViewActivity.TITLE,"用户协议");
+                intent.putExtra(AboutWebViewActivity.URL, NetInfo.AGREEMENT_URL);
+                startActivity(intent);
+                break;
+            case R.id.agree_radio:
+                doAgreeCheck();
+                break;
         }
     }
 
@@ -264,5 +289,62 @@ public class RegisterActivity extends SheishuoUI implements View.OnClickListener
         }
     }
 
+    void doAgreeCheck()
+    {
+        isAgree = !isAgree;
+        agreeRadioBtn.setChecked(isAgree);
+    }
+
+
+    @Override
+    public boolean dispatchTouchEvent(MotionEvent ev) {
+        if (ev.getAction() == MotionEvent.ACTION_DOWN) {
 
+            // 获得当前得到焦点的View,一般情况下就是EditText(特殊情况就是轨迹求或者实体案件会移动焦点)
+            View v = getCurrentFocus();
+
+            if (isShouldHideInput(v, ev)) {
+                hideSoftInput(v.getWindowToken());
+            }
+        }
+        return super.dispatchTouchEvent(ev);
+    }
+
+    /**
+     * 根据EditText所在坐标和用户点击的坐标相对比,来判断是否隐藏键盘,因为当用户点击EditText时没必要隐藏
+     *
+     * @param v
+     * @param event
+     * @return
+     */
+    private boolean isShouldHideInput(View v, MotionEvent event) {
+        if (v != null && (v instanceof EditText)) {
+            int[] l = { 0, 0 };
+            v.getLocationInWindow(l);
+            int left = l[0], top = l[1], bottom = top + v.getHeight(), right = left
+                    + v.getWidth();
+            if (event.getX() > left && event.getX() < right
+                    && event.getY() > top && event.getY() < bottom) {
+                // 点击EditText的事件,忽略它。
+                return false;
+            } else {
+                return true;
+            }
+        }
+        // 如果焦点不是EditText则忽略,这个发生在视图刚绘制完,第一个焦点不在EditView上,和用户用轨迹球选择其他的焦点
+        return false;
+    }
+
+    /**
+     * 多种隐藏软件盘方法的其中一种
+     *
+     * @param token
+     */
+    private void hideSoftInput(IBinder token) {
+        if (token != null) {
+            InputMethodManager im = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
+            im.hideSoftInputFromWindow(token,
+                    InputMethodManager.HIDE_NOT_ALWAYS);
+        }
+    }
 }

+ 10 - 3
app/src/com/sheishuo/app/main/adapter/CircleListAdapter.java

@@ -79,6 +79,8 @@ public class CircleListAdapter  extends RecyclerView.Adapter<CircleListAdapter.C
         holder.likesNumTV.setText(bean.getLikes());
         holder.visitNumTv.setText(bean.getViews());
         holder.usernameTV.setText(getUserName(bean.getUser_id()));
+        holder.usernameTV.setOnClickListener(this);
+        holder.usernameTV.setTag(bean);
 
         //直接评论
         holder.commentTV.setOnClickListener(new View.OnClickListener() {
@@ -100,7 +102,8 @@ public class CircleListAdapter  extends RecyclerView.Adapter<CircleListAdapter.C
         holder.gridView.setAdapter(gridViewAdapter);
 
 
-
+        holder.avatarContainer.setOnClickListener(this);
+        holder.avatarContainer.setTag(bean);
 
         //加载朋友圈列表用户头像
         if (NIMClient.getService(UserService.class).getUserInfo(bean.getUser_id())!= null){
@@ -321,7 +324,10 @@ public class CircleListAdapter  extends RecyclerView.Adapter<CircleListAdapter.C
                 case R.id.circle_item_layout:
                     listener.onItemClick(v);
                     break;
-
+                case R.id.avatar_container:
+                case R.id.username_tv:
+                    listener.onUserClick(v);
+                    break;
             }
         }
 
@@ -332,7 +338,7 @@ public class CircleListAdapter  extends RecyclerView.Adapter<CircleListAdapter.C
     //ViewHolder
     class CircleListViewHolder extends RecyclerView.ViewHolder{
         private LinearLayout layout;
-        private LinearLayout commentsLayout;
+        private LinearLayout commentsLayout, avatarContainer;
         private TextView usernameTV
                 ,contentTV
                 ,locationTV
@@ -367,6 +373,7 @@ public class CircleListAdapter  extends RecyclerView.Adapter<CircleListAdapter.C
             //firstCommentTV = (TextView) v.findViewById(R.id.circle_comment_first_tv);
             //secondCommentTV = (TextView) v.findViewById(R.id.circle_comment_second_tv);
 
+            avatarContainer = (LinearLayout) v.findViewById(R.id.avatar_container);
             avatar = (ImageView) v.findViewById(R.id.avatar_img);
             likedImg = (ImageView) v.findViewById(R.id.liked_img);
             //firstCommentImg = (ImageView) v.findViewById(R.id.circle_comment_first_img);

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

@@ -8,6 +8,6 @@ import android.view.View;
 
 public interface OnCircleItemClickListener {
     void onItemClick(View view);
-
     void onLikedClick(View view);
+    void onUserClick(View view);
 }

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

@@ -49,7 +49,7 @@ public class AreaGroupsFragment extends MainTabFragment {
     private String TAG = this.getClass().getSimpleName();
     private Context context = getActivity();
     private BaseToolbar toolbar;
-    private TextView toolbarLeftTxt;
+    private TextView toolbarLeftTxt, createGroupTxt;
     private MainActivity parent;
 
     private RecyclerView areaGroupsRecyclerview, recentGroupsRecyclerview;
@@ -77,6 +77,7 @@ public class AreaGroupsFragment extends MainTabFragment {
         recentGroupsRecyclerview = findView(R.id.area_groups_nearby_recyclerview);
         moreAreaGroupsTV = findView(R.id.area_groups_more_rooms_tv);
         nearbyGroupsTV = findView(R.id.area_groups_nearby_groups_TV);
+        createGroupTxt = findView(R.id.create_area_group);
     }
 
 
@@ -103,6 +104,13 @@ public class AreaGroupsFragment extends MainTabFragment {
                 startActivity(new Intent(getActivity(), NearbyGroupActivity.class));
             }
         });
+
+        createGroupTxt.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                startActivity(new Intent(getActivity(), CreateNewGroupActivity.class));
+            }
+        });
     }
 
     //初始化Toolbar

+ 6 - 0
app/src/com/sheishuo/app/main/fragment/CircleOfFriendsFragment.java

@@ -31,6 +31,7 @@ import com.sheishuo.app.core_module.circle.activity.CircleDetailsActivity;
 import com.sheishuo.app.core_module.circle.activity.NewTweetingActivity;
 import com.sheishuo.app.common.beans.CircleBean;
 import com.sheishuo.app.common.views.BaseToolbar;
+import com.sheishuo.app.core_module.mine.view.ui.activity.UserInfoDetailActivity;
 import com.sheishuo.app.main.activity.MainActivity;
 import com.sheishuo.app.main.adapter.CircleListAdapter;
 import com.sheishuo.app.main.adapter.OnCircleItemClickListener;
@@ -206,7 +207,12 @@ public class CircleOfFriendsFragment extends MainTabFragment{
                             CircleBean.DBean.ListBean bean = (CircleBean.DBean.ListBean) view.getTag();
                             Log.e(TAG,"点赞的朋友圈ID === " + bean.getId());
                             presenter.onUserLiked(bean.getId());
+                        }
 
+                        @Override
+                        public void onUserClick(View view) {
+                            CircleBean.DBean.ListBean bean = (CircleBean.DBean.ListBean) view.getTag();
+                            UserInfoDetailActivity.start(getContext(), bean.getUser_id());
                         }
                     });
 

+ 71 - 94
app/src/com/sheishuo/app/main/fragment/TradeListFragment.java

@@ -4,6 +4,7 @@ import android.content.Context;
 import android.content.Intent;
 import android.os.Bundle;
 import android.os.Handler;
+import android.support.annotation.IdRes;
 import android.support.annotation.Nullable;
 import android.support.design.widget.FloatingActionButton;
 import android.support.v7.widget.CardView;
@@ -17,6 +18,7 @@ import android.view.View;
 import android.view.ViewGroup;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
+import android.widget.RadioGroup;
 import android.widget.TextView;
 import android.widget.Toast;
 
@@ -29,9 +31,11 @@ import com.sheishuo.app.SheishuoCache;
 import com.sheishuo.app.cache.AccountCache;
 import com.sheishuo.app.common.beans.TradeBean;
 import com.sheishuo.app.common.views.BaseToolbar;
+import com.sheishuo.app.core_module.mine.view.ui.activity.UserInfoDetailActivity;
 import com.sheishuo.app.core_module.trade.model.TradeModel;
 import com.sheishuo.app.core_module.trade.presenter.TradePresenter;
 import com.sheishuo.app.core_module.trade.view.adapter.TradeItemAdapter;
+import com.sheishuo.app.core_module.trade.view.popup.TradeSortPopupWindow;
 import com.sheishuo.app.core_module.trade.view.ui.activity.TradeChangePriorityActivity;
 import com.sheishuo.app.core_module.trade.view.ui.activity.TradeDetailsActivity;
 import com.sheishuo.app.core_module.trade.view.ui.activity.TradePublishActivity;
@@ -67,85 +71,28 @@ public class TradeListFragment extends MainTabFragment {
     private List<MenuItem> menuItems = new ArrayList<>();
     private Menu menu;
     private FloatingActionButton fab;
+    private TradeSortPopupWindow popupWindow;
+    private TextView sortTxt;
 
     /**
      * FLAGS
      */
     public int PAGE_TO_LOAD = 1;
     public int TYPE_TO_LOAD = TradeModel.TYPE_ALL;
-    public int MENU_ITEM_CHECKED = R.id.trade_menu_all;
+    public int MENU_ITEM_CHECKED = R.id.trade_sort_0;
     public TextView priorityTV = null;
     public String priorityBeanId;
 
     @Override
     public void onCreate(@Nullable Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
-        setHasOptionsMenu(true);
     }
 
-    @Override
-    public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
-        this.menu = menu;
-//        inflater.inflate(R.menu.trade_menu,menu);
-//        for (int i = 0 ; i < menu.getItem(1).getSubMenu().size() ; i++){
-//            menuItems.add(menu.getItem(1).getSubMenu().getItem(i));
-//        }
-        super.onCreateOptionsMenu(menu, inflater);
-    }
-
-    @Override
-    public boolean onOptionsItemSelected(MenuItem item) {
-
-        if (item.getItemId() == R.id.trade_menu_search){
-            Intent intent = new Intent(getActivity(), TradeSearchActivity.class);
-            startActivityForResult(intent,0);
-            return false;
-        }
-
-        if (item.getItemId() == MENU_ITEM_CHECKED || item.getItemId() == R.id.trade_menu_filter){
-            return false;
-        }
-
-        MENU_ITEM_CHECKED = item.getItemId();
-        setAllMenuItemUnchecked(menuItems);
-        item.setChecked(true);
-        clearTradeList();
-        switch (item.getItemId()){
-            case R.id.trade_menu_all:
-                loadTradeList(TradeModel.TYPE_ALL,1);
-                break;
-            case R.id.trade_menu_buy:
-                loadTradeList(TradeModel.TYPE_BUY,1);
-                break;
-            case R.id.trade_menu_sell:
-                loadTradeList(TradeModel.TYPE_SELL,1);
-                break;
-            case R.id.trade_menu_recent:
-                loadTradeList(TradeModel.TYPE_RECENT,1);
-                break;
-            case R.id.trade_menu_concern:
-                loadTradeList(TradeModel.TYPE_CONCERN,1);
-                break;
-            case R.id.trade_menu_mine:
-                loadTradeList(TradeModel.TYPE_MINE,1);
-                break;
-        }
-        return super.onOptionsItemSelected(item);
-    }
-
-
-    private void setAllMenuItemUnchecked(List<MenuItem> menuItems){
-        for (MenuItem item:menuItems){
-            item.setChecked(false);
-        }
-    }
-
-
-
 
     @Override
     protected void onInit() {
         presenter = new TradePresenter(this);
+        popupWindow = new TradeSortPopupWindow(getActivity());
         findViews();
         init();
 
@@ -176,10 +123,6 @@ public class TradeListFragment extends MainTabFragment {
                 startActivity(new Intent(getActivity(), TradePublishActivity.class));
             }
         });
-
-
-
-
     }
 
     private void initToolbar(){
@@ -199,29 +142,44 @@ public class TradeListFragment extends MainTabFragment {
             }
         });
 
-        TextView textView = new TextView(getContext());
-        textView.setText("筛选");
-        textView.setOnClickListener(new View.OnClickListener(){
+        sortTxt = new TextView(getContext());
+        sortTxt.setText("筛选");
+        sortTxt.setOnClickListener(new View.OnClickListener(){
             @Override
             public void onClick(View v){
-                Log.d("haha", "2");
+                showPopup();
             }
         });
 
-        toolbar.setRightItems(new View[]{searchIcon, textView});
+        toolbar.setRightItems(new View[]{searchIcon, sortTxt});
         toolbar.setLeftItems(new View[0]);
     }
 
-    private static List<PopupMenuItem> getSortMenuItems(Context context, String sessionId, SessionTypeEnum sessionTypeEnum) {
-//        List<PopupMenuItem> moreMenuItems = new ArrayList<PopupMenuItem>();
-//        moreMenuItems.add(new PopupMenuItem(context, ACTION_HISTORY_QUERY, sessionId,
-//                sessionTypeEnum, SheishuoCache.getContext().getString(R.string.message_history_query)));
-//        moreMenuItems.add(new PopupMenuItem(context, ACTION_SEARCH_MESSAGE, sessionId,
-//                sessionTypeEnum, SheishuoCache.getContext().getString(R.string.message_search_title)));
-//        moreMenuItems.add(new PopupMenuItem(context, ACTION_CLEAR_MESSAGE, sessionId,
-//                sessionTypeEnum, SheishuoCache.getContext().getString(R.string.message_clear)));
-//        return moreMenuItems;
-        return null;
+    private void showPopup()
+    {
+        popupWindow.showPopupWindow(sortTxt, MENU_ITEM_CHECKED);
+        popupWindow.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
+            @Override
+            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
+                MENU_ITEM_CHECKED = checkedId;
+                clearTradeList();
+                switch (checkedId){
+                    case R.id.trade_sort_0:
+                        loadTradeList(TradeModel.TYPE_ALL,1);
+                        break;
+                    case R.id.trade_sort_1:
+                        loadTradeList(TradeModel.TYPE_RECENT,1);
+                        break;
+                    case R.id.trade_sort_2:
+                        loadTradeList(TradeModel.TYPE_SELL,1);
+                        break;
+                    case R.id.trade_sort_3:
+                        loadTradeList(TradeModel.TYPE_BUY,1);
+                        break;
+                }
+                popupWindow.dismiss();
+            }
+        });
     }
 
 
@@ -240,7 +198,12 @@ public class TradeListFragment extends MainTabFragment {
                         Intent intent = new Intent(getActivity(), TradeDetailsActivity.class);
                         intent.putExtra(TradeDetailsActivity.DATA,bean);
                         startActivity(intent);
-                    }else if (view instanceof ImageView){
+                    }
+                    else if(view.getId() == R.id.trade_list_item_avatar || view.getId() == R.id.trade_list_item_name)
+                    {
+                        UserInfoDetailActivity.start(getContext(), (String) view.getTag(R.id.user_account));
+                    }
+                    else if (view instanceof ImageView){
 
                         String id;
                         if ((id = (String) view.getTag(R.drawable.trade_unfollowed)) != null){
@@ -251,17 +214,22 @@ public class TradeListFragment extends MainTabFragment {
                             presenter.unfollowTrade(id);
                         }
 
-                    }else if (view instanceof TextView){
-                        priorityTV = (TextView) view;
-                        priorityBeanId = (String) view.getTag(R.id.flag_trade_id);
-                        String priority = (String) view.getTag(R.id.flag_trade_priority);
-                        String priorityType = (String) view.getTag(R.id.flag_trade_priority_type);
-                        Intent intent = new Intent(getActivity(),TradeChangePriorityActivity.class);
-                        Bundle data = new Bundle();
-                        data.putString(TradeChangePriorityActivity.TRADE_PRIORITY,priority);
-                        data.putString(TradeChangePriorityActivity.TRADE_PRIORITY_TYPE,priorityType);
-                        intent.putExtras(data);
-                        startActivityForResult(intent,TradeChangePriorityActivity.TRADE_CHANGE_PRIORITY);
+                    }
+                    else if (view.getId() == R.id.trade_list_item_priority){
+
+                        String userId = (String) view.getTag(R.id.user_account);
+                        if(userId.equals(AccountCache.getAccount().getId())) {
+                            priorityTV = (TextView) view;
+                            priorityBeanId = (String) view.getTag(R.id.flag_trade_id);
+                            String priority = (String) view.getTag(R.id.flag_trade_priority);
+                            String priorityType = (String) view.getTag(R.id.flag_trade_priority_type);
+                            Intent intent = new Intent(getActivity(), TradeChangePriorityActivity.class);
+                            Bundle data = new Bundle();
+                            data.putString(TradeChangePriorityActivity.TRADE_PRIORITY, priority);
+                            data.putString(TradeChangePriorityActivity.TRADE_PRIORITY_TYPE, priorityType);
+                            intent.putExtras(data);
+                            startActivityForResult(intent, TradeChangePriorityActivity.TRADE_CHANGE_PRIORITY);
+                        }
 
                     }else {
                         Log.e(TAG,"未识别View");
@@ -292,7 +260,7 @@ public class TradeListFragment extends MainTabFragment {
             Bundle bundle = data.getExtras();
             String priority = bundle.getString(TradeChangePriorityActivity.TRADE_PRIORITY);
             String priorityType = bundle.getString(TradeChangePriorityActivity.TRADE_PRIORITY_TYPE);
-            if (adapter != null) adapter.updateTradePriority(priorityBeanId,priority);
+            presenter.updatePriority(priorityBeanId, priority);
 
         }else if (TradeSearchActivity.RESULT_CODE == resultCode){
             if (adapter != null){
@@ -374,5 +342,14 @@ public class TradeListFragment extends MainTabFragment {
         });
     }
 
-
+    public void onPriorityUpdate(final String tradeId, final String priority)
+    {
+        getHandler().postDelayed(new Runnable() {
+            @Override
+            public void run() {
+                if(adapter != null)
+                    adapter.updateTradePriority(tradeId, priority);
+            }
+        }, 100);
+    }
 }

+ 13 - 1
uikit/res/layout/gift_panel.xml

@@ -91,7 +91,6 @@
         </LinearLayout>
 
 
-
         <LinearLayout
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
@@ -120,6 +119,19 @@
                 android:gravity="center"
                 android:text="1" />
         </LinearLayout>
+
+        <TextView
+            android:id="@+id/textView2"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center"
+            android:layout_marginBottom="-5dp"
+            android:layout_marginTop="-5dp"
+            android:enabled="false"
+            android:text="一天可发布三条,道具数量决定快讯排名"
+            android:textColor="@android:color/holo_red_dark"
+            android:textSize="10sp" />
+
         <LinearLayout
             android:layout_width="match_parent"
             android:layout_height="wrap_content"

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

@@ -131,7 +131,7 @@ public class TeamMessageActivity extends BaseMessageActivity {
         team = d;
         fragment.setTeam(team);
 
-        setTitle(team == null ? sessionId : team.getName() + "(" + team.getMemberCount() + "人)");
+        setTitle("     "+team == null ? sessionId : team.getName() + "(" + team.getMemberCount() + "人)");
 
         invalidTeamTipText.setText(team.getType() == TeamTypeEnum.Normal ? R.string.normal_team_invalid_tip : R.string.team_invalid_tip);
         invalidTeamTipView.setVisibility(team.isMyTeam() ? View.GONE : View.VISIBLE);

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