Junqin Wang 8 years ago
parent
commit
330882aee7
67 changed files with 1093 additions and 173 deletions
  1. 3 0
      app/AndroidManifest.xml
  2. 7 7
      app/app.iml
  3. BIN
      app/res/drawable-hdpi/mine_edit_photos.png
  4. BIN
      app/res/drawable-hdpi/mine_gender_female.png
  5. BIN
      app/res/drawable-hdpi/mine_gender_male.png
  6. BIN
      app/res/drawable-hdpi/mine_nearby_people.png
  7. BIN
      app/res/drawable-hdpi/mine_settings.png
  8. BIN
      app/res/drawable-hdpi/mine_settings_white.png
  9. BIN
      app/res/drawable-hdpi/mine_trade.png
  10. BIN
      app/res/drawable-hdpi/right_arrow.png
  11. BIN
      app/res/drawable-mdpi/mine_edit_photos.png
  12. BIN
      app/res/drawable-mdpi/mine_gender_female.png
  13. BIN
      app/res/drawable-mdpi/mine_gender_male.png
  14. BIN
      app/res/drawable-mdpi/mine_nearby_people.png
  15. BIN
      app/res/drawable-mdpi/mine_settings.png
  16. BIN
      app/res/drawable-mdpi/mine_settings_white.png
  17. BIN
      app/res/drawable-mdpi/mine_trade.png
  18. BIN
      app/res/drawable-mdpi/right_arrow.png
  19. BIN
      app/res/drawable-xhdpi/mine_edit_photos.png
  20. BIN
      app/res/drawable-xhdpi/mine_gender_female.png
  21. BIN
      app/res/drawable-xhdpi/mine_gender_male.png
  22. BIN
      app/res/drawable-xhdpi/mine_nearby_people.png
  23. BIN
      app/res/drawable-xhdpi/mine_settings.png
  24. BIN
      app/res/drawable-xhdpi/mine_settings_white.png
  25. BIN
      app/res/drawable-xhdpi/mine_trade.png
  26. BIN
      app/res/drawable-xhdpi/right_arrow.png
  27. BIN
      app/res/drawable-xxhdpi/mine_edit_photos.png
  28. BIN
      app/res/drawable-xxhdpi/mine_gender_female.png
  29. BIN
      app/res/drawable-xxhdpi/mine_gender_male.png
  30. BIN
      app/res/drawable-xxhdpi/mine_nearby_people.png
  31. BIN
      app/res/drawable-xxhdpi/mine_settings.png
  32. BIN
      app/res/drawable-xxhdpi/mine_settings_white.png
  33. BIN
      app/res/drawable-xxhdpi/mine_trade.png
  34. BIN
      app/res/drawable-xxhdpi/right_arrow.png
  35. BIN
      app/res/drawable-xxxhdpi/mine_edit_photos.png
  36. BIN
      app/res/drawable-xxxhdpi/mine_gender_female.png
  37. BIN
      app/res/drawable-xxxhdpi/mine_gender_male.png
  38. BIN
      app/res/drawable-xxxhdpi/mine_nearby_people.png
  39. BIN
      app/res/drawable-xxxhdpi/mine_settings.png
  40. BIN
      app/res/drawable-xxxhdpi/mine_settings_white.png
  41. BIN
      app/res/drawable-xxxhdpi/mine_trade.png
  42. BIN
      app/res/drawable-xxxhdpi/right_arrow.png
  43. 1 1
      app/res/layout/area_group_item.xml
  44. 9 5
      app/res/layout/base_toolbar.xml
  45. 43 30
      app/res/layout/circle_new_tweeting.xml
  46. 5 6
      app/res/layout/circle_of_friends_fragment.xml
  47. 229 12
      app/res/layout/mine_fragment.xml
  48. 36 0
      app/res/layout/mine_personal_settings.xml
  49. 1 1
      app/res/layout/setting_item_base.xml
  50. 0 4
      app/res/values-v11/styles-activity.xml
  51. 0 3
      app/res/values-v14/styles-activity.xml
  52. 3 0
      app/res/values-v19/styles-activity.xml
  53. 1 0
      app/res/values/styles-activity.xml
  54. 14 0
      app/src/com/sheishuo/app/common/beans/CityDataBean.java
  55. 331 0
      app/src/com/sheishuo/app/common/beans/SocialBean.java
  56. 9 0
      app/src/com/sheishuo/app/common/util/location/CityDataHelper.java
  57. 1 1
      app/src/com/sheishuo/app/common/util/net/INet.java
  58. 78 51
      app/src/com/sheishuo/app/common/util/net/NetImpl.java
  59. 1 0
      app/src/com/sheishuo/app/common/util/net/NetInfo.java
  60. 8 0
      app/src/com/sheishuo/app/common/views/BaseToolbar.java
  61. 10 0
      app/src/com/sheishuo/app/core_module/social_info/model/SocialBeanModel.java
  62. 39 0
      app/src/com/sheishuo/app/core_module/social_info/view/ui/activity/PersonalSettingsActivity.java
  63. 5 1
      app/src/com/sheishuo/app/main/activity/MainActivity.java
  64. 7 3
      app/src/com/sheishuo/app/main/adapter/AreaGroupsAdapter.java
  65. 5 1
      app/src/com/sheishuo/app/main/fragment/CircleOfFriendsFragment.java
  66. 53 45
      app/src/com/sheishuo/app/main/fragment/HomeFragment.java
  67. 194 2
      app/src/com/sheishuo/app/main/fragment/MineFragment.java

+ 3 - 0
app/AndroidManifest.xml

@@ -118,6 +118,9 @@
         <activity android:name=".core_module.circle.activity.NewTweetingActivity"
             android:theme="@style/AppTheme.NoActionBar"/>
 
+        <!--我的 相关-->
+        <activity android:name=".core_module.social_info.view.ui.activity.PersonalSettingsActivity"
+            android:theme="@style/AppTheme.NoActionBar"/>
 
         <!--交易帖详情-->
         <activity android:name=".core_module.trade.view.ui.activity.TradeDetailActivity"

+ 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/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" />
-      <sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
-      <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" />
@@ -73,6 +66,13 @@
       <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" />
+      <sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
+      <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" />
       <excludeFolder url="file://$MODULE_DIR$/build/.DS_Store" />
       <excludeFolder url="file://$MODULE_DIR$/build/freeline" />
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/.DS_Store" />

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


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


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


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


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


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


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


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


BIN
app/res/drawable-mdpi/mine_edit_photos.png


BIN
app/res/drawable-mdpi/mine_gender_female.png


BIN
app/res/drawable-mdpi/mine_gender_male.png


BIN
app/res/drawable-mdpi/mine_nearby_people.png


BIN
app/res/drawable-mdpi/mine_settings.png


BIN
app/res/drawable-mdpi/mine_settings_white.png


BIN
app/res/drawable-mdpi/mine_trade.png


BIN
app/res/drawable-mdpi/right_arrow.png


BIN
app/res/drawable-xhdpi/mine_edit_photos.png


BIN
app/res/drawable-xhdpi/mine_gender_female.png


BIN
app/res/drawable-xhdpi/mine_gender_male.png


BIN
app/res/drawable-xhdpi/mine_nearby_people.png


BIN
app/res/drawable-xhdpi/mine_settings.png


BIN
app/res/drawable-xhdpi/mine_settings_white.png


BIN
app/res/drawable-xhdpi/mine_trade.png


BIN
app/res/drawable-xhdpi/right_arrow.png


BIN
app/res/drawable-xxhdpi/mine_edit_photos.png


BIN
app/res/drawable-xxhdpi/mine_gender_female.png


BIN
app/res/drawable-xxhdpi/mine_gender_male.png


BIN
app/res/drawable-xxhdpi/mine_nearby_people.png


BIN
app/res/drawable-xxhdpi/mine_settings.png


BIN
app/res/drawable-xxhdpi/mine_settings_white.png


BIN
app/res/drawable-xxhdpi/mine_trade.png


BIN
app/res/drawable-xxhdpi/right_arrow.png


BIN
app/res/drawable-xxxhdpi/mine_edit_photos.png


BIN
app/res/drawable-xxxhdpi/mine_gender_female.png


BIN
app/res/drawable-xxxhdpi/mine_gender_male.png


BIN
app/res/drawable-xxxhdpi/mine_nearby_people.png


BIN
app/res/drawable-xxxhdpi/mine_settings.png


BIN
app/res/drawable-xxxhdpi/mine_settings_white.png


BIN
app/res/drawable-xxxhdpi/mine_trade.png


BIN
app/res/drawable-xxxhdpi/right_arrow.png


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

@@ -15,7 +15,7 @@
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:padding="10dp">
-        <ImageView
+        <com.netease.nim.uikit.common.ui.imageview.HeadImageView
             android:id="@+id/area_groups_item_avatar"
             android:layout_width="48dp"
             android:layout_height="48dp"

+ 9 - 5
app/res/layout/base_toolbar.xml

@@ -1,11 +1,14 @@
 <?xml version="1.0" encoding="utf-8"?>
-<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
-    android:layout_height="wrap_content"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
-    app:theme="@style/fullToolbarStyle">
+    android:layout_height="wrap_content">
 
+    <android.support.v7.widget.Toolbar
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        style="@style/fullToolbarStyle">
         <LinearLayout
+            android:id="@+id/toolbar_layout"
             android:layout_width="match_parent"
             android:layout_height="?attr/actionBarSize"
             android:background="@color/colorPrimary"
@@ -48,4 +51,5 @@
                 android:visibility="gone"
                 android:gravity="center"/>
         </LinearLayout>
-</android.support.v7.widget.Toolbar>
+    </android.support.v7.widget.Toolbar>
+</LinearLayout>

+ 43 - 30
app/res/layout/circle_new_tweeting.xml

@@ -1,47 +1,58 @@
 <?xml version="1.0" encoding="utf-8"?>
 <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
     xmlns:app="http://schemas.android.com/apk/res-auto"
-    android:orientation="vertical"
+    xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
-    android:layout_height="match_parent">
-    <com.sheishuo.app.common.views.BaseToolbar
+    android:layout_height="match_parent"
+    android:orientation="vertical">
+
+    <android.support.design.widget.AppBarLayout
+        android:id="@+id/new_tweet_appbar"
         android:layout_width="0dp"
         android:layout_height="wrap_content"
-        style="@style/fullToolbarStyle"
-        app:title="发布"
-        app:left_text="返回"
-        app:right_text="确定"
-        app:layout_constraintRight_toRightOf="parent"
+        tools:layout_editor_absoluteX="0dp"
+        tools:layout_editor_absoluteY="0dp"
         app:layout_constraintLeft_toLeftOf="parent"
-        app:layout_constraintTop_toTopOf="parent"
-        android:id="@+id/new_tweet_toolbar" />
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toTopOf="parent">
+
+        <com.sheishuo.app.common.views.BaseToolbar
+            android:id="@+id/new_tweet_toolbar"
+            style="@style/fullToolbarStyle"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            app:left_text="返回"
+            app:right_text="确定"
+            app:title="发布" />
+    </android.support.design.widget.AppBarLayout>
+
 
     <EditText
         android:id="@+id/new_tweet_content"
         android:layout_width="0dp"
         android:layout_height="256dp"
-        android:ems="10"
-        android:inputType="textPersonName"
-        android:layout_marginRight="8dp"
-        app:layout_constraintRight_toRightOf="@+id/new_tweet_toolbar"
+        android:layout_marginEnd="8dp"
         android:layout_marginLeft="8dp"
-        app:layout_constraintLeft_toLeftOf="@+id/new_tweet_toolbar"
+        android:layout_marginRight="8dp"
+        android:layout_marginStart="8dp"
         android:layout_marginTop="20dp"
-        app:layout_constraintTop_toBottomOf="@+id/new_tweet_toolbar"
+        android:ems="10"
         android:gravity="start"
         android:hint="您想说点什么..."
+        android:inputType="textPersonName"
         app:layout_constraintHorizontal_bias="0.0"
-        android:layout_marginStart="8dp"
-        android:layout_marginEnd="8dp" />
+        app:layout_constraintLeft_toLeftOf="@+id/new_tweet_appbar"
+        app:layout_constraintRight_toRightOf="@+id/new_tweet_appbar"
+        app:layout_constraintTop_toBottomOf="@+id/new_tweet_appbar" />
+
     <HorizontalScrollView
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:orientation="horizontal"
         android:layout_marginTop="8dp"
-        app:layout_constraintTop_toBottomOf="@+id/linearLayout2"
+        android:orientation="horizontal"
+        android:scrollbarAlwaysDrawHorizontalTrack="true"
         app:layout_constraintLeft_toLeftOf="@+id/new_tweet_content"
-        android:scrollbarAlwaysDrawHorizontalTrack="true">
+        app:layout_constraintTop_toBottomOf="@+id/linearLayout2">
 
         <LinearLayout
             android:id="@+id/new_tweet_img_layout"
@@ -53,31 +64,33 @@
                 android:id="@+id/new_tweet_add_imgs"
                 android:layout_width="128dp"
                 android:layout_height="128dp"
-                android:src="@drawable/circle_new_tweet_img"/>
+                android:src="@drawable/circle_new_tweet_img" />
         </LinearLayout>
     </HorizontalScrollView>
 
 
     <LinearLayout
+        android:id="@+id/linearLayout2"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
+        android:layout_marginLeft="8dp"
+        android:layout_marginStart="8dp"
+        android:layout_marginTop="8dp"
         android:background="@color/grey_light_light"
         android:padding="4dp"
-        android:layout_marginLeft="8dp"
         app:layout_constraintLeft_toLeftOf="@+id/new_tweet_content"
-        android:layout_marginTop="8dp"
-        app:layout_constraintTop_toBottomOf="@+id/new_tweet_content"
-        android:id="@+id/linearLayout2"
-        android:layout_marginStart="8dp">
+        app:layout_constraintTop_toBottomOf="@+id/new_tweet_content">
+
         <ImageView
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:src="@drawable/location"/>
+            android:src="@drawable/location" />
+
         <TextView
             android:id="@+id/new_tweet_location_tv"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:text="未定位"
-            android:textColor="@color/grey_light"/>
+            android:textColor="@color/grey_light" />
     </LinearLayout>
 </android.support.constraint.ConstraintLayout>

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

@@ -4,14 +4,13 @@
     xmlns:my="http://schemas.android.com/tools"
     android:id="@+id/main_content"
     android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:fitsSystemWindows="false">
+    android:layout_height="match_parent">
 
     <android.support.design.widget.AppBarLayout
         android:id="@+id/appbar"
         android:layout_width="match_parent"
-        android:layout_height="256dp"
-        android:fitsSystemWindows="true">
+        android:layout_height="256dp">
+        <!--android:fitsSystemWindows="true">-->
 
         <android.support.design.widget.CollapsingToolbarLayout
             android:id="@+id/collapsing_toolbar"
@@ -30,8 +29,8 @@
                 android:layout_width="match_parent"
                 android:layout_height="match_parent"
                 android:orientation="vertical"
-                app:layout_collapseMode="parallax"
-                android:fitsSystemWindows="true"   >
+                app:layout_collapseMode="parallax">
+                <!--android:fitsSystemWindows="true"   >-->
                 <ImageView
                     android:id="@+id/circle_background"
                     android:layout_width="match_parent"

+ 229 - 12
app/res/layout/mine_fragment.xml

@@ -1,16 +1,233 @@
 <?xml version="1.0" encoding="utf-8"?>
-<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical" android:layout_width="match_parent"
+<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:id="@+id/mine_layout"
+    android:layout_width="match_parent"
     android:layout_height="match_parent"
-    style="@style/fullToolbarStyle"
-    android:fitsSystemWindows="true">
+    android:orientation="vertical">
 
-    <ImageView
+
+    <LinearLayout
         android:layout_width="match_parent"
-        android:layout_height="192dp"
-        android:src="@drawable/avchat_call_bg"
-        android:scaleType="center"/>
-    <com.netease.nim.uikit.common.ui.imageview.HeadImageView
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" />
-</android.support.design.widget.CoordinatorLayout>
+        android:layout_height="match_parent"
+        android:orientation="vertical">
+
+        <android.support.design.widget.CoordinatorLayout
+            android:layout_width="match_parent"
+            android:layout_height="240dp">
+
+
+
+            <ImageView
+                android:id="@+id/mine_fragment_banner"
+                android:layout_width="match_parent"
+                android:layout_height="192dp"
+                android:scaleType="center"
+                android:src="@drawable/avchat_call_bg" />
+
+            <ImageView
+                android:id="@+id/mine_fragment_personal_settings"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:src="@drawable/mine_settings_white"
+                app:layout_anchor="@id/mine_fragment_banner"
+                app:layout_anchorGravity="top|end"
+                android:layout_margin="16dp"/>
+
+            <com.netease.nim.uikit.common.ui.imageview.HeadImageView
+                android:id="@+id/mine_fragment_avatar"
+                android:layout_width="96dp"
+                android:layout_height="96dp"
+                android:src="@drawable/nim_avatar_group"
+                app:layout_anchor="@id/mine_fragment_banner"
+                app:layout_anchorGravity="bottom|center" />
+
+            <ImageView
+                android:id="@+id/mine_fragment_gender"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:src="@drawable/mine_gender_male"
+                app:layout_anchor="@id/mine_fragment_avatar"
+                app:layout_anchorGravity="right|bottom"
+                android:layout_margin="16dp"
+                android:layout_marginEnd="10dp"
+                android:layout_marginRight="10dp"/>
+
+
+        </android.support.design.widget.CoordinatorLayout>
+
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:gravity="center"
+            android:orientation="vertical">
+
+            <TextView
+                android:id="@+id/mine_fragment_username_tv"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_gravity="center_horizontal"
+                android:layout_marginTop="16dp"
+                android:text="用户昵称"
+                android:textSize="16sp"
+                android:textStyle="bold" />
+
+            <TextView
+                android:id="@+id/mine_fragment_id_tv"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_gravity="center_horizontal"
+                android:text="id:000000000" />
+
+            <GridLayout
+                android:id="@+id/mine_fragment_photos_layout"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:columnCount="4">
+
+                <LinearLayout
+                    android:layout_width="96dp"
+                    android:layout_height="96dp"
+                    android:gravity="center"
+                    android:orientation="vertical">
+
+                    <ImageView
+                        android:id="@+id/mine_fragment_edit_photos_img"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:src="@drawable/mine_edit_photos" />
+
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:text="添加照片" />
+                </LinearLayout>
+
+            </GridLayout>
+
+            <LinearLayout
+                android:id="@+id/mine_fragment_options_layout"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:background="@color/color_background"
+                android:orientation="vertical"
+                android:paddingBottom="4dp"
+                android:paddingTop="4dp">
+
+                <!--附近的人-->
+                <LinearLayout
+                    android:id="@+id/mine_fragment_nearby_people"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:background="@color/white"
+                    android:clickable="true"
+                    android:orientation="horizontal"
+                    android:padding="8dp">
+
+                    <ImageView
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="2"
+                        android:src="@drawable/mine_nearby_people" />
+
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_vertical"
+                        android:layout_marginLeft="8dp"
+                        android:layout_marginStart="8dp"
+                        android:layout_weight="7"
+                        android:text="附近的人"
+                        android:textStyle="bold" />
+
+                    <ImageView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_vertical"
+                        android:layout_marginEnd="8dp"
+                        android:layout_marginRight="8dp"
+                        android:layout_weight="1"
+                        android:src="@drawable/right_arrow" />
+                </LinearLayout>
+
+
+                <!--我的便民帖-->
+                <LinearLayout
+                    android:id="@+id/mine_fragment_trade"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:background="@color/white"
+                    android:clickable="true"
+                    android:orientation="horizontal"
+                    android:padding="8dp">
+
+                    <ImageView
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="2"
+                        android:src="@drawable/mine_trade" />
+
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_vertical"
+                        android:layout_marginLeft="8dp"
+                        android:layout_marginStart="8dp"
+                        android:layout_weight="7"
+                        android:text="我的便民帖"
+                        android:textStyle="bold" />
+
+                    <ImageView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_vertical"
+                        android:layout_marginEnd="8dp"
+                        android:layout_marginRight="8dp"
+                        android:layout_weight="1"
+                        android:src="@drawable/right_arrow" />
+                </LinearLayout>
+
+                <!--设置-->
+                <LinearLayout
+                    android:id="@+id/mine_fragment_setting"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:background="@color/white"
+                    android:clickable="true"
+                    android:orientation="horizontal"
+                    android:padding="8dp">
+
+                    <ImageView
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="2"
+                        android:src="@drawable/mine_settings" />
+
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_vertical"
+                        android:layout_marginLeft="8dp"
+                        android:layout_marginStart="8dp"
+                        android:layout_weight="8"
+                        android:text="设置"
+                        android:textStyle="bold" />
+
+                    <ImageView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_vertical"
+                        android:layout_marginEnd="8dp"
+                        android:layout_marginRight="8dp"
+                        android:layout_weight="1"
+                        android:src="@drawable/right_arrow" />
+                </LinearLayout>
+            </LinearLayout>
+
+
+        </LinearLayout>
+
+
+    </LinearLayout>
+</ScrollView>

+ 36 - 0
app/res/layout/mine_personal_settings.xml

@@ -0,0 +1,36 @@
+<?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.support.design.widget.AppBarLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content">
+        <com.sheishuo.app.common.views.BaseToolbar
+            android:layout_width="match_parent"
+            android:layout_height="@dimen/action_bar_height"
+            android:title="设置"
+            app:left_text="返回"
+            style="@style/fullToolbarStyle"/>
+    </android.support.design.widget.AppBarLayout>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:padding="16dp"
+        android:orientation="horizontal">
+        <TextView
+            android:layout_weight="9"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:text="头像"
+            android:layout_gravity="center_vertical"/>
+
+        <!--官方给定长宽-->
+        <com.netease.nim.uikit.common.ui.widget.SwitchButton
+            android:layout_width="58dip"
+            android:layout_height="36.67dp"
+            android:layout_gravity="end"/>
+    </LinearLayout>
+</LinearLayout>

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

@@ -82,7 +82,7 @@
         android:layout_toRightOf="@+id/title_label"
         android:ellipsize="end"
         android:gravity="right"
-        android:singleLine="true"
+        android:maxLines="1"
         android:textColor="@color/color_black_ff666666"
         android:textSize="16sp"
         android:visibility="gone" />

+ 0 - 4
app/res/values-v11/styles-activity.xml

@@ -1,4 +0,0 @@
-<resources>
-
-
-</resources>

+ 0 - 3
app/res/values-v14/styles-activity.xml

@@ -1,3 +0,0 @@
-<resources>
-
-</resources>

+ 3 - 0
app/res/values-v19/styles-activity.xml

@@ -5,4 +5,7 @@
         <item name="windowActionBar">false</item>
         <item name="windowNoTitle">true</item>
     </style>
+
+
+
 </resources>

+ 1 - 0
app/res/values/styles-activity.xml

@@ -15,6 +15,7 @@
     <style name="AppTheme.NoActionBar">
         <item name="windowActionBar">false</item>
         <item name="windowNoTitle">true</item>
+        <item name="colorPrimary">@color/transparent</item>
     </style>
 
 

File diff suppressed because it is too large
+ 14 - 0
app/src/com/sheishuo/app/common/beans/CityDataBean.java


+ 331 - 0
app/src/com/sheishuo/app/common/beans/SocialBean.java

@@ -0,0 +1,331 @@
+package com.sheishuo.app.common.beans;
+
+import java.util.List;
+
+/**
+ * Created by KN on 2017/8/8.
+ */
+
+public class SocialBean {
+
+
+    /**
+     * c : 0
+     * d : {"id":"200030","pwd":"e10adc3949ba59abbe56e057f20f883e","nick":"","mobile":"18523545395","coin":"1100","room_id":"0","latitude":"37.785834","longitude":"-122.406417","province":"重庆市","city":"重庆市","district":"北碚区","social_bg_aid":"0","create_time":"2017-07-13 17:11:53","user_id":"200030","age":"0","show_age":"1","real_name":"","id_number":"","social_banner":"","add_verify":"0","find_mobile":"0","find_id":"0","find_nick":"0","see_social":"0","effect":"0","hobby":"","address":"","follow":0,"photos":[]}
+     */
+
+    private int c;
+    private DBean d;
+
+    public int getC() {
+        return c;
+    }
+
+    public void setC(int c) {
+        this.c = c;
+    }
+
+    public DBean getD() {
+        return d;
+    }
+
+    public void setD(DBean d) {
+        this.d = d;
+    }
+
+    public static class DBean {
+        /**
+         * id : 200030
+         * pwd : e10adc3949ba59abbe56e057f20f883e
+         * nick :
+         * mobile : 18523545395
+         * coin : 1100
+         * room_id : 0
+         * latitude : 37.785834
+         * longitude : -122.406417
+         * province : 重庆市
+         * city : 重庆市
+         * district : 北碚区
+         * social_bg_aid : 0
+         * create_time : 2017-07-13 17:11:53
+         * user_id : 200030
+         * age : 0
+         * show_age : 1
+         * real_name :
+         * id_number :
+         * social_banner :
+         * add_verify : 0
+         * find_mobile : 0
+         * find_id : 0
+         * find_nick : 0
+         * see_social : 0
+         * effect : 0
+         * hobby :
+         * address :
+         * follow : 0
+         * photos : []
+         */
+
+        private String id;
+        private String pwd;
+        private String nick;
+        private String mobile;
+        private String coin;
+        private String room_id;
+        private String latitude;
+        private String longitude;
+        private String province;
+        private String city;
+        private String district;
+        private String social_bg_aid;
+        private String create_time;
+        private String user_id;
+        private String age;
+        private String show_age;
+        private String real_name;
+        private String id_number;
+        private String social_banner;
+        private String add_verify;
+        private String find_mobile;
+        private String find_id;
+        private String find_nick;
+        private String see_social;
+        private String effect;
+        private String hobby;
+        private String address;
+        private int follow;
+        private List<?> photos;
+
+        public String getId() {
+            return id;
+        }
+
+        public void setId(String id) {
+            this.id = id;
+        }
+
+        public String getPwd() {
+            return pwd;
+        }
+
+        public void setPwd(String pwd) {
+            this.pwd = pwd;
+        }
+
+        public String getNick() {
+            return nick;
+        }
+
+        public void setNick(String nick) {
+            this.nick = nick;
+        }
+
+        public String getMobile() {
+            return mobile;
+        }
+
+        public void setMobile(String mobile) {
+            this.mobile = mobile;
+        }
+
+        public String getCoin() {
+            return coin;
+        }
+
+        public void setCoin(String coin) {
+            this.coin = coin;
+        }
+
+        public String getRoom_id() {
+            return room_id;
+        }
+
+        public void setRoom_id(String room_id) {
+            this.room_id = room_id;
+        }
+
+        public String getLatitude() {
+            return latitude;
+        }
+
+        public void setLatitude(String latitude) {
+            this.latitude = latitude;
+        }
+
+        public String getLongitude() {
+            return longitude;
+        }
+
+        public void setLongitude(String longitude) {
+            this.longitude = longitude;
+        }
+
+        public String getProvince() {
+            return province;
+        }
+
+        public void setProvince(String province) {
+            this.province = province;
+        }
+
+        public String getCity() {
+            return city;
+        }
+
+        public void setCity(String city) {
+            this.city = city;
+        }
+
+        public String getDistrict() {
+            return district;
+        }
+
+        public void setDistrict(String district) {
+            this.district = district;
+        }
+
+        public String getSocial_bg_aid() {
+            return social_bg_aid;
+        }
+
+        public void setSocial_bg_aid(String social_bg_aid) {
+            this.social_bg_aid = social_bg_aid;
+        }
+
+        public String getCreate_time() {
+            return create_time;
+        }
+
+        public void setCreate_time(String create_time) {
+            this.create_time = create_time;
+        }
+
+        public String getUser_id() {
+            return user_id;
+        }
+
+        public void setUser_id(String user_id) {
+            this.user_id = user_id;
+        }
+
+        public String getAge() {
+            return age;
+        }
+
+        public void setAge(String age) {
+            this.age = age;
+        }
+
+        public String getShow_age() {
+            return show_age;
+        }
+
+        public void setShow_age(String show_age) {
+            this.show_age = show_age;
+        }
+
+        public String getReal_name() {
+            return real_name;
+        }
+
+        public void setReal_name(String real_name) {
+            this.real_name = real_name;
+        }
+
+        public String getId_number() {
+            return id_number;
+        }
+
+        public void setId_number(String id_number) {
+            this.id_number = id_number;
+        }
+
+        public String getSocial_banner() {
+            return social_banner;
+        }
+
+        public void setSocial_banner(String social_banner) {
+            this.social_banner = social_banner;
+        }
+
+        public String getAdd_verify() {
+            return add_verify;
+        }
+
+        public void setAdd_verify(String add_verify) {
+            this.add_verify = add_verify;
+        }
+
+        public String getFind_mobile() {
+            return find_mobile;
+        }
+
+        public void setFind_mobile(String find_mobile) {
+            this.find_mobile = find_mobile;
+        }
+
+        public String getFind_id() {
+            return find_id;
+        }
+
+        public void setFind_id(String find_id) {
+            this.find_id = find_id;
+        }
+
+        public String getFind_nick() {
+            return find_nick;
+        }
+
+        public void setFind_nick(String find_nick) {
+            this.find_nick = find_nick;
+        }
+
+        public String getSee_social() {
+            return see_social;
+        }
+
+        public void setSee_social(String see_social) {
+            this.see_social = see_social;
+        }
+
+        public String getEffect() {
+            return effect;
+        }
+
+        public void setEffect(String effect) {
+            this.effect = effect;
+        }
+
+        public String getHobby() {
+            return hobby;
+        }
+
+        public void setHobby(String hobby) {
+            this.hobby = hobby;
+        }
+
+        public String getAddress() {
+            return address;
+        }
+
+        public void setAddress(String address) {
+            this.address = address;
+        }
+
+        public int getFollow() {
+            return follow;
+        }
+
+        public void setFollow(int follow) {
+            this.follow = follow;
+        }
+
+        public List<?> getPhotos() {
+            return photos;
+        }
+
+        public void setPhotos(List<?> photos) {
+            this.photos = photos;
+        }
+    }
+}

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

@@ -0,0 +1,9 @@
+package com.sheishuo.app.common.util.location;
+
+/**
+ * Created by KN on 2017/8/14.
+ */
+
+public class CityDataHelper {
+    
+}

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

@@ -16,5 +16,5 @@ public interface INet {
     void loginQuery(String mobile,String pwd,ResponseCallback callback);
     void getGiftList(ResponseCallback callback);
     void uploadCircleImgs(String filePath, ResponseCallback callback);
-
+    void getSocialInfo(String targetID,ResponseCallback callback);
 }

+ 78 - 51
app/src/com/sheishuo/app/common/util/net/NetImpl.java

@@ -1,12 +1,9 @@
 package com.sheishuo.app.common.util.net;
 
-import android.util.Log;
-
 import com.google.gson.Gson;
-import com.google.gson.JsonObject;
 import com.sheishuo.app.cache.AccountCache;
-import com.sheishuo.app.cache.GiftCache;
 import com.sheishuo.app.common.beans.GiftBean;
+import com.sheishuo.app.common.beans.SocialBean;
 import com.sheishuo.app.login.beans.LoginBean;
 
 import org.json.JSONException;
@@ -14,12 +11,10 @@ import org.json.JSONObject;
 
 import java.io.File;
 import java.io.IOException;
-import java.util.List;
 
 import okhttp3.Call;
 import okhttp3.Callback;
 import okhttp3.FormBody;
-import okhttp3.MediaType;
 import okhttp3.MultipartBody;
 import okhttp3.OkHttpClient;
 import okhttp3.Request;
@@ -30,7 +25,7 @@ import okhttp3.Response;
  * Created by KN on 2017/7/14.
  */
 
-public class  NetImpl implements INet {
+public class NetImpl implements INet {
 
 
     private static OkHttpClient client = new OkHttpClient.Builder().build();
@@ -42,7 +37,7 @@ public class  NetImpl implements INet {
     }
 
     @Override
-    public void post(String url, FormBody body,ResponseCallback callback) {
+    public void post(String url, FormBody body, ResponseCallback callback) {
         Request request = new Request.Builder()
                 .url(url)
                 .post(body)
@@ -51,9 +46,9 @@ public class  NetImpl implements INet {
         try {
             Response response = client.newCall(request).execute();
 
-            if (200 == response.code()){
+            if (200 == response.code()) {
                 callback.onSuccess(response.body().string());
-            }else {
+            } else {
                 callback.onFailed();
             }
 
@@ -73,9 +68,9 @@ public class  NetImpl implements INet {
         try {
             Response response = client.newCall(request).execute();
 
-            if (200 == response.code()){
+            if (200 == response.code()) {
                 callback.onSuccess(response.body().string());
-            }else {
+            } else {
                 callback.onFailed();
             }
 
@@ -88,51 +83,50 @@ public class  NetImpl implements INet {
     @Override
     public void loginQuery(String mobile, String pwd, final ResponseCallback callback) {
         final FormBody body = new FormBody.Builder()
-                .add("mobile",mobile)
-                .add("pwd",pwd)
+                .add("mobile", mobile)
+                .add("pwd", pwd)
                 .build();
 
         new Thread(new Runnable() {
-                    @Override
-                    public void run() {
-
-                        //创建FormBody
-                        Request request = new Request.Builder()
-                                .post(body)
-                                .url(NetInfo.INDEX + NetInfo.LOGIN_URL)
-                                .build();
-
-
-                        //发起请求并完成回调
-                        try {
-                            Response response = client.newCall(request).execute();
-
-                            if (200 == response.code()){
-                                LoginBean bean = gson.fromJson(response.body().string(),LoginBean.class);
-                                switch (bean.getC()){
-                                    case 0:
-                                        callback.onSuccess(bean);
-                                        break;
-                                    default:
-                                        callback.onFailed();
-                                        break;
-                                }
-                            }else {
-                                callback.onFailed();
-                            }
+            @Override
+            public void run() {
+
+                //创建FormBody
+                Request request = new Request.Builder()
+                        .post(body)
+                        .url(NetInfo.INDEX + NetInfo.LOGIN_URL)
+                        .build();
 
-                        } catch (Exception e) {
-                            e.printStackTrace();
-                            callback.onFailed();
+
+                //发起请求并完成回调
+                try {
+                    Response response = client.newCall(request).execute();
+
+                    if (200 == response.code()) {
+                        LoginBean bean = gson.fromJson(response.body().string(), LoginBean.class);
+                        switch (bean.getC()) {
+                            case 0:
+                                callback.onSuccess(bean);
+                                break;
+                            default:
+                                callback.onFailed();
+                                break;
                         }
+                    } else {
+                        callback.onFailed();
                     }
+
+                } catch (Exception e) {
+                    e.printStackTrace();
+                    callback.onFailed();
                 }
+            }
+        }
         ).start();
 
     }
 
 
-
     @Override
     public void getGiftList(final ResponseCallback callback) {
 
@@ -146,11 +140,11 @@ public class  NetImpl implements INet {
                             .build();
                     Response response = client.newCall(request).execute();
 
-                    if (200 == response.code()){
+                    if (200 == response.code()) {
                         String result = response.body().string();
-                        GiftBean.DBean gift = (new Gson().fromJson(result,GiftBean.class)).getD();
+                        GiftBean.DBean gift = (new Gson().fromJson(result, GiftBean.class)).getD();
                         callback.onSuccess(gift);
-                    }else {
+                    } else {
                         callback.onFailed();
                     }
 
@@ -170,7 +164,7 @@ public class  NetImpl implements INet {
         builder.setType(MultipartBody.FORM);
 
         builder.addFormDataPart("user_id", AccountCache.getAccount().getId());
-        builder.addFormDataPart("upload",file.getName(), RequestBody.create(null,file));
+        builder.addFormDataPart("upload", file.getName(), RequestBody.create(null, file));
 
 
         RequestBody body = builder.build();
@@ -191,10 +185,10 @@ public class  NetImpl implements INet {
             public void onResponse(Call call, Response response) throws IOException {
                 try {
                     JSONObject jsonObject = new JSONObject(response.body().string());
-                    if (jsonObject.getInt("c") == 0){
+                    if (jsonObject.getInt("c") == 0) {
                         int imgCode = jsonObject.getJSONObject("d").getInt("aid");
                         callback.onSuccess(imgCode);
-                    }else {
+                    } else {
                         callback.onFailed();
                     }
                 } catch (JSONException e) {
@@ -205,5 +199,38 @@ public class  NetImpl implements INet {
         });
     }
 
+    @Override
+    public void getSocialInfo(final String targetID, final ResponseCallback callback) {
+        new Thread(new Runnable() {
+            @Override
+            public void run() {
+                FormBody body = new FormBody.Builder()
+                        .add("user_id", AccountCache.getAccount().getId())
+                        .add("target_id", targetID)
+                        .build();
+                Request request = new Request.Builder()
+                        .url(NetInfo.GET_SOCIAL_INFO)
+                        .post(body)
+                        .build();
+                try {
+                    Response response = client.newCall(request).execute();
+                    if (200 == response.code()) {
+
+                        String result = response.body().string();
+                        SocialBean bean = new Gson().fromJson(result, SocialBean.class);
+                        callback.onSuccess(bean);
+
+
+                    } else {
+                        callback.onFailed();
+                    }
+                } catch (IOException e) {
+                    e.printStackTrace();
+                    callback.onFailed();
+                }
+            }
+        }).start();
+    }
+
 
 }

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

@@ -18,4 +18,5 @@ public class NetInfo {
     public final static String TRADE_LIST = INDEX + "?m=who&c=trade&a=lists";
     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=index&a=gift_list";
 }

+ 8 - 0
app/src/com/sheishuo/app/common/views/BaseToolbar.java

@@ -28,10 +28,12 @@ public class BaseToolbar extends Toolbar {
 
     private final String TITLE = "title",LEFT_TEXT = "left_text",RIGHT_TEXT = "right_text";
     private static Context context;
+    private LinearLayout toolbarLayout;
     private String titleStr = "",leftStr = "",rightStr = "";
     private TextView titleTV,leftTV,rightTV;
     private LinearLayout icoLayout;
 
+
     public interface IcoBtnClickListener{
         void onClick(View view);
     }
@@ -70,9 +72,14 @@ public class BaseToolbar extends Toolbar {
         leftTV = (TextView) view.findViewById(R.id.toolbar_left);
         rightTV = (TextView) view.findViewById(R.id.toolbar_right);
         icoLayout = (LinearLayout) view.findViewById(R.id.toolbar_ico_layout);
+        toolbarLayout = (LinearLayout) view.findViewById(R.id.toolbar_layout);
     }
 
 
+    public LinearLayout getToolbarLayout() {
+        return toolbarLayout;
+    }
+
     public TextView getTitleTV() {
         return titleTV;
     }
@@ -87,6 +94,7 @@ public class BaseToolbar extends Toolbar {
 
 
     public void init(){
+        this.setVisibility(VISIBLE);
         titleTV.setVisibility(INVISIBLE);
         leftTV.setVisibility(INVISIBLE);
         rightTV.setVisibility(INVISIBLE);

+ 10 - 0
app/src/com/sheishuo/app/core_module/social_info/model/SocialBeanModel.java

@@ -0,0 +1,10 @@
+package com.sheishuo.app.core_module.social_info.model;
+
+import com.sheishuo.app.common.beans.SocialBean;
+
+/**
+ * Created by KN on 2017/8/8.
+ */
+
+public class SocialBeanModel {
+}

+ 39 - 0
app/src/com/sheishuo/app/core_module/social_info/view/ui/activity/PersonalSettingsActivity.java

@@ -0,0 +1,39 @@
+package com.sheishuo.app.core_module.social_info.view.ui.activity;
+
+import android.content.Context;
+import android.content.Intent;
+import android.os.Bundle;
+
+import com.sheishuo.app.R;
+import com.sheishuo.app.uikit_implements.SheishuoUI;
+
+/**
+ * Created by KN on 2017/8/10.
+ */
+
+public class PersonalSettingsActivity extends SheishuoUI {
+
+
+    public static void start(Context context){
+        start(context,null);
+    }
+
+    public static void start(Context context , Intent data){
+        Intent intent = new Intent();
+        intent.setClass(context, PersonalSettingsActivity.class);
+        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
+        if (data != null) {
+            intent.putExtras(data);
+        }
+        context.startActivity(intent);
+    }
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.mine_personal_settings);
+    }
+
+
+
+}

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

@@ -38,6 +38,7 @@ import com.sheishuo.app.contact.activity.AddFriendActivity;
 import com.sheishuo.app.login.LoginActivity;
 import com.sheishuo.app.login.LogoutHelperBak;
 import com.sheishuo.app.main.fragment.HomeFragment;
+import com.sheishuo.app.main.fragment.MineFragment;
 import com.sheishuo.app.main.model.Extras;
 import com.sheishuo.app.session.SessionHelper;
 import com.sheishuo.app.team.TeamCreateHelper;
@@ -255,7 +256,10 @@ public class MainActivity extends SheishuoUI {
     @Override
     public void onActivityResult(int requestCode, int resultCode, Intent data) {
         Log.e(TAG,"onActivityResult " + requestCode + "    " + resultCode);
-        if (resultCode == Activity.RESULT_OK) {
+
+        if(requestCode == MineFragment.AVATAR_SELECTED || requestCode == MineFragment.BANNER_SELECTED){
+            mainFragment.onActivityResult(requestCode,resultCode,data);
+        }else if (resultCode == Activity.RESULT_OK) {
             if (requestCode == REQUEST_CODE_NORMAL) {
                 final ArrayList<String> selected = data.getStringArrayListExtra(ContactSelectActivity.RESULT_DATA);
                 if (selected != null && !selected.isEmpty()) {

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

@@ -9,6 +9,7 @@ import android.widget.ImageView;
 import android.widget.TextView;
 
 import com.bumptech.glide.Glide;
+import com.netease.nim.uikit.common.ui.imageview.HeadImageView;
 import com.netease.nimlib.sdk.InvocationFuture;
 import com.netease.nimlib.sdk.NIMClient;
 import com.netease.nimlib.sdk.RequestCallback;
@@ -55,7 +56,10 @@ public class AreaGroupsAdapter  extends RecyclerView.Adapter<AreaGroupsAdapter.A
                 if (team.getIcon().isEmpty()){
                     Glide.with(context).load(R.drawable.nim_avatar_group).into(holder.groupIco);
                 }else {
-                    Glide.with(context).load(team.getIcon()).into(holder.groupIco);
+                    Glide.with(context)
+                            .load(team.getIcon())
+                            .placeholder(R.drawable.nim_avatar_group)
+                            .into(holder.groupIco);
                 }
             }
 
@@ -93,12 +97,12 @@ public class AreaGroupsAdapter  extends RecyclerView.Adapter<AreaGroupsAdapter.A
 
     class AreaGroupsViewHold extends RecyclerView.ViewHolder{
         View layout;
-        ImageView groupIco;
+        HeadImageView groupIco;
         TextView groupName,groupMemberNum;
         public AreaGroupsViewHold(View itemView) {
             super(itemView);
             layout = itemView.findViewById(R.id.area_groups_layout);
-            groupIco = (ImageView) itemView.findViewById(R.id.area_groups_item_avatar);
+            groupIco = (HeadImageView) itemView.findViewById(R.id.area_groups_item_avatar);
             groupName = (TextView) itemView.findViewById(R.id.group_name);
             groupMemberNum = (TextView) itemView.findViewById(R.id.group_member_num);
         }

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

@@ -2,11 +2,15 @@ package com.sheishuo.app.main.fragment;
 
 import android.content.Context;
 import android.content.Intent;
+import android.graphics.Color;
+import android.os.Build;
 import android.os.Handler;
 import android.support.v7.widget.LinearLayoutManager;
 import android.support.v7.widget.RecyclerView;
 import android.util.Log;
 import android.view.View;
+import android.view.Window;
+import android.view.WindowManager;
 import android.widget.ImageView;
 import android.widget.TextView;
 import android.widget.Toast;
@@ -72,6 +76,7 @@ public class CircleOfFriendsFragment extends MainTabFragment{
             Log.e(TAG,"Yes");
         }
 
+
         presenter.loadCircleList(AccountCache.getAccount().getId(),"0");
 
         //初始化朋友圈首页界面
@@ -140,7 +145,6 @@ public class CircleOfFriendsFragment extends MainTabFragment{
 
         if (isVisibleToUser && isLoaded) refreshCircle();
 
-
         NetStatus.IS_BUSY = false;
     }
 

+ 53 - 45
app/src/com/sheishuo/app/main/fragment/HomeFragment.java

@@ -5,7 +5,6 @@ import android.content.Context;
 import android.content.Intent;
 import android.os.Bundle;
 import android.support.annotation.NonNull;
-import android.support.annotation.Nullable;
 import android.support.design.widget.BottomNavigationView;
 import android.support.v4.app.Fragment;
 import android.support.v4.view.ViewPager;
@@ -13,8 +12,6 @@ import android.support.v4.view.ViewPager.OnPageChangeListener;
 import android.support.v7.widget.Toolbar;
 import android.util.Log;
 import android.view.LayoutInflater;
-import android.view.Menu;
-import android.view.MenuInflater;
 import android.view.MenuItem;
 import android.view.View;
 import android.view.ViewGroup;
@@ -32,8 +29,8 @@ import com.netease.nimlib.sdk.msg.SystemMessageService;
 import com.netease.nimlib.sdk.msg.constant.SessionTypeEnum;
 import com.netease.nimlib.sdk.msg.model.RecentContact;
 import com.netease.nimlib.sdk.team.TeamService;
-import com.sheishuo.app.cache.AccountCache;
 import com.sheishuo.app.R;
+import com.sheishuo.app.cache.AccountCache;
 import com.sheishuo.app.common.ui.viewpager.FadeInOutPageTransformer;
 import com.sheishuo.app.common.ui.viewpager.PagerSlidingTabStrip;
 import com.sheishuo.app.common.views.BottomNavigationViewEx;
@@ -98,7 +95,6 @@ public class HomeFragment extends TFragment implements OnPageChangeListener, Rem
         autoJoinAreaChat();
 
 
-
         //暂时用来解决无法加载首页的bug
         getHandler().postDelayed(new Runnable() {
             @Override
@@ -106,40 +102,40 @@ public class HomeFragment extends TFragment implements OnPageChangeListener, Rem
                 pager.setCurrentItem(1);
                 pager.setCurrentItem(0);
             }
-        },300);
+        }, 300);
 
 
     }
 
 
     //自动加入地区群聊
-    public void autoJoinAreaChat(){
+    public void autoJoinAreaChat() {
         List<String> autoJoinList = new ArrayList<>();
         autoJoinList.add(AccountCache.getAccount().getCountry_room_id());
         autoJoinList.add(AccountCache.getAccount().getProvince_room_id());
         autoJoinList.add(AccountCache.getAccount().getCity_room_id());
         autoJoinList.add(AccountCache.getAccount().getDistrict_room_id());
 
-        for(String roomId : autoJoinList){
-            if (roomId != null)NIMClient.getService(TeamService.class).applyJoinTeam(roomId, null);
+        for (String roomId : autoJoinList) {
+            if (roomId != null) NIMClient.getService(TeamService.class).applyJoinTeam(roomId, null);
         }
 
     }
 
     //初始化BottomNavigationView
-    public void initBottomNavigationView(){
+    public void initBottomNavigationView() {
         navigationbarItemList.add(R.id.main_navi_groups);
         navigationbarItemList.add(R.id.main_navi_friends);
         navigationbarItemList.add(R.id.main_navi_trade);
         navigationbarItemList.add(R.id.main_navi_circle_of_friends);
         navigationbarItemList.add(R.id.main_navi_me);
-        if (navigationView != null){
+        if (navigationView != null) {
             navigationView.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() {
                 @Override
                 public boolean onNavigationItemSelected(@NonNull MenuItem item) {
-                    for(int position = 0;position < navigationbarItemList.size();position++){
+                    for (int position = 0; position < navigationbarItemList.size(); position++) {
 
-                        if (navigationbarItemList.get(position) == item.getItemId()){
+                        if (navigationbarItemList.get(position) == item.getItemId()) {
                             pager.setCurrentItem(position);
                         }
                     }
@@ -157,7 +153,6 @@ public class HomeFragment extends TFragment implements OnPageChangeListener, Rem
     }
 
 
-
     @Override
     public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
         // TO TABS
@@ -181,12 +176,11 @@ public class HomeFragment extends TFragment implements OnPageChangeListener, Rem
     }
 
 
-    public Toolbar getToolbar(){
-        return ((MainActivity)getActivity()).getToolBar();
+    public Toolbar getToolbar() {
+        return ((MainActivity) getActivity()).getToolBar();
     }
 
 
-
     @Override
     public void onPageScrollStateChanged(int state) {
         // TO TABS
@@ -200,7 +194,7 @@ public class HomeFragment extends TFragment implements OnPageChangeListener, Rem
     private void selectPage(int page) {
         // TO PAGE
         if (scrollState == ViewPager.SCROLL_STATE_IDLE) {
-            Log.e(TAG,"currentItem" + pager.getCurrentItem());
+            Log.e(TAG, "currentItem" + pager.getCurrentItem());
             adapter.onPageSelected(pager.getCurrentItem());
         }
     }
@@ -223,7 +217,6 @@ public class HomeFragment extends TFragment implements OnPageChangeListener, Rem
     }
 
 
-
     @Override
     public void onResume() {
         super.onResume();
@@ -360,32 +353,32 @@ public class HomeFragment extends TFragment implements OnPageChangeListener, Rem
 
         DropManager.getInstance().init(getContext(), (DropCover) findView(R.id.unread_cover),
                 new DropCover.IDropCompletedListener() {
-            @Override
-            public void onCompleted(Object id, boolean explosive) {
-                if (id == null || !explosive) {
-                    return;
-                }
+                    @Override
+                    public void onCompleted(Object id, boolean explosive) {
+                        if (id == null || !explosive) {
+                            return;
+                        }
 
-                if (id instanceof RecentContact) {
-                    RecentContact r = (RecentContact) id;
-                    NIMClient.getService(MsgService.class).clearUnreadCount(r.getContactId(), r.getSessionType());
-                    LogUtil.i("HomeFragment", "clearUnreadCount, sessionId=" + r.getContactId());
-                } else if (id instanceof String) {
-                    if (((String) id).contentEquals("0")) {
-                        List<RecentContact> recentContacts = NIMClient.getService(MsgService.class).queryRecentContactsBlock();
-                        for (RecentContact r : recentContacts) {
-                            if (r.getUnreadCount() > 0) {
-                                NIMClient.getService(MsgService.class).clearUnreadCount(r.getContactId(), r.getSessionType());
+                        if (id instanceof RecentContact) {
+                            RecentContact r = (RecentContact) id;
+                            NIMClient.getService(MsgService.class).clearUnreadCount(r.getContactId(), r.getSessionType());
+                            LogUtil.i("HomeFragment", "clearUnreadCount, sessionId=" + r.getContactId());
+                        } else if (id instanceof String) {
+                            if (((String) id).contentEquals("0")) {
+                                List<RecentContact> recentContacts = NIMClient.getService(MsgService.class).queryRecentContactsBlock();
+                                for (RecentContact r : recentContacts) {
+                                    if (r.getUnreadCount() > 0) {
+                                        NIMClient.getService(MsgService.class).clearUnreadCount(r.getContactId(), r.getSessionType());
+                                    }
+                                }
+                                LogUtil.i("HomeFragment", "clearAllUnreadCount");
+                            } else if (((String) id).contentEquals("1")) {
+                                NIMClient.getService(SystemMessageService.class).resetSystemMessageUnreadCount();
+                                LogUtil.i("HomeFragment", "clearAllSystemUnreadCount");
                             }
                         }
-                        LogUtil.i("HomeFragment", "clearAllUnreadCount");
-                    } else if (((String) id).contentEquals("1")) {
-                        NIMClient.getService(SystemMessageService.class).resetSystemMessageUnreadCount();
-                        LogUtil.i("HomeFragment", "clearAllSystemUnreadCount");
                     }
-                }
-            }
-        });
+                });
     }
 
 
@@ -393,21 +386,36 @@ public class HomeFragment extends TFragment implements OnPageChangeListener, Rem
     @Override
     public void onActivityResult(int requestCode, int resultCode, Intent data) {
         //super.onActivityResult(requestCode, resultCode, data);
-        switch (resultCode){
+        Log.e(TAG, requestCode + "   " + resultCode);
+
+        //我的 选择照片回调
+        if (resultCode == Activity.RESULT_OK && (requestCode == MineFragment.AVATAR_SELECTED || requestCode == MineFragment.BANNER_SELECTED)) {
+            for (Fragment fragment : getFragmentManager().getFragments()) {
+                if (fragment instanceof MineFragment)
+                    fragment.onActivityResult(requestCode, resultCode, data);
+
+            }
+            //防止往下传递,为什么不会消耗掉这个事件?
+            resultCode = -9999;
+        }
+
+
+        switch (resultCode) {
             //创建群回调
             case Activity.RESULT_OK:
                 List<String> memberList = data.getStringArrayListExtra(ContactSelectActivity.RESULT_DATA);
-                TeamCreateHelper.createAdvancedTeam(context,memberList);
+                TeamCreateHelper.createAdvancedTeam(context, memberList);
                 break;
 
             //朋友圈自动刷新回调
             case CircleOfFriendsFragment.REFRESH_CIRCLE:
-                for (Fragment fragment : getFragmentManager().getFragments()){
+                for (Fragment fragment : getFragmentManager().getFragments()) {
                     if (fragment instanceof CircleOfFriendsFragment)
-                        fragment.onActivityResult(requestCode,resultCode,data);
+                        fragment.onActivityResult(requestCode, resultCode, data);
 
                 }
                 break;
+
         }
     }
 

+ 194 - 2
app/src/com/sheishuo/app/main/fragment/MineFragment.java

@@ -1,14 +1,206 @@
 package com.sheishuo.app.main.fragment;
 
-import com.sheishuo.app.main.model.MainTab;
+import android.app.Activity;
+import android.content.Intent;
+import android.graphics.Color;
+import android.os.Build;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.View;
+import android.view.Window;
+import android.view.WindowManager;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.ScrollView;
+import android.widget.TextView;
+
+import com.bumptech.glide.Glide;
+import com.netease.nim.uikit.common.media.picker.PickImageHelper;
+import com.netease.nim.uikit.common.media.picker.model.PhotoInfo;
+import com.netease.nimlib.sdk.NIMClient;
+import com.netease.nimlib.sdk.uinfo.UserInfoProvider;
+import com.netease.nimlib.sdk.uinfo.UserService;
+import com.sheishuo.app.R;
+import com.sheishuo.app.cache.AccountCache;
+import com.sheishuo.app.common.views.BaseToolbar;
+import com.sheishuo.app.core_module.social_info.view.ui.activity.PersonalSettingsActivity;
+import com.sheishuo.app.main.activity.MainActivity;
+
+import java.util.List;
 
 /**
  * Created by KN on 2017/8/8.
  */
 
-public class MineFragment extends MainTabFragment {
+public class MineFragment extends MainTabFragment implements View.OnClickListener{
+    private String TAG = this.getClass().getSimpleName();
+
+    private MainActivity parent;
+    private BaseToolbar toolbar;
+    private ScrollView layout;
+    private ImageView avatarImg,settingsImg,bannerImg,editPhotoImg;
+    private TextView usernameTV,userIdTV;
+    private LinearLayout neabyPeopleOption,mineTradeOption,settingsOptions;
+
+
+
+    //FLAGS
+    public final static int AVATAR_SELECTED = 2000;
+    public final static int BANNER_SELECTED = 2001;
+    @Override
+    public void onActivityCreated(Bundle savedInstanceState) {
+        super.onActivityCreated(savedInstanceState);
+        onCurrent();
+
+    }
+
     @Override
     protected void onInit() {
+        findViews();
+        init();
+    }
+
+
+    private void findViews(){
+        parent = (MainActivity) getActivity();
+        toolbar = (BaseToolbar) parent.getToolBar();
+        layout = findView(R.id.mine_layout);
+        avatarImg = findView(R.id.mine_fragment_avatar);
+        settingsImg = findView(R.id.mine_fragment_personal_settings);
+        bannerImg = findView(R.id.mine_fragment_banner);
+        usernameTV = findView(R.id.mine_fragment_username_tv);
+        userIdTV = findView(R.id.mine_fragment_id_tv);
+        editPhotoImg = findView(R.id.mine_fragment_edit_photos_img);
+        neabyPeopleOption = findView(R.id.mine_fragment_nearby_people);
+        mineTradeOption = findView(R.id.mine_fragment_trade);
+        settingsOptions = findView(R.id.mine_fragment_setting);
+
+        avatarImg.setOnClickListener(this);
+        bannerImg.setOnClickListener(this);
+        settingsImg.setOnClickListener(this);
+        editPhotoImg.setOnClickListener(this);
+        neabyPeopleOption.setOnClickListener(this);
+        mineTradeOption.setOnClickListener(this);
+        settingsOptions.setOnClickListener(this);
+
+    }
+
+    private void init(){
+        initToolbar();
+        if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+            Window window = parent.getWindow();
+            window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS
+                    | WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
+            window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
+                    | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
+            window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
+            window.setStatusBarColor(Color.TRANSPARENT);
+        }
+
+
+        UserInfoProvider.UserInfo user = NIMClient.getService(UserService.class).getUserInfo(AccountCache.getAccount().getId());
+        if (user.getAvatar() != null)
+            Glide.with(getActivity()).load(user.getAvatar()).into(avatarImg);
+
+        usernameTV.setText(getName(AccountCache.getAccount().getId()));
+        userIdTV.setText("ID:" + AccountCache.getAccount().getId());
+
+    }
+
+
+    private void initToolbar(){
+        toolbar.init();
+        toolbar.setVisibility(View.GONE);
+    }
 
+    private String getName(String id){
+        UserInfoProvider.UserInfo user = NIMClient.getService(UserService.class).getUserInfo(id);
+        if (!(user.getName() == null)){
+            return user.getName();
+        }
+        return id;
     }
+    @Override
+    public void setUserVisibleHint(boolean isVisibleToUser) {
+        super.setUserVisibleHint(isVisibleToUser);
+
+
+        if (isVisibleToUser && toolbar != null && parent != null){
+            initToolbar();
+            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+                parent.getWindow().setStatusBarColor(getResources().getColor(android.R.color.transparent));
+            }
+
+        }else if (parent != null){
+            Log.e(TAG,"setFitsSystemWindows False");
+        }
+    }
+
+    @Override
+    public void onClick(View v) {
+        switch (v.getId()){
+            case R.id.mine_fragment_avatar:
+                pickImage(MineFragment.AVATAR_SELECTED);
+                break;
+            case R.id.mine_fragment_banner:
+                pickImage(MineFragment.BANNER_SELECTED);
+                break;
+            case R.id.mine_fragment_personal_settings:
+                PersonalSettingsActivity.start(getActivity().getApplicationContext());
+                break;
+            case R.id.mine_fragment_edit_photos_img:
+                break;
+            case R.id.mine_fragment_nearby_people:
+                break;
+            case R.id.mine_fragment_trade:
+                break;
+            case R.id.mine_fragment_setting:
+                break;
+        }
+    }
+
+    @Override
+    public void onActivityResult(int requestCode, int resultCode, Intent data) {
+        super.onActivityResult(requestCode, resultCode, data);
+        if (resultCode == Activity.RESULT_OK){
+            Bundle result = data.getExtras();
+            if (!result.getBoolean("from_local")) {
+                //照相机
+                String filePath = result.getString("file_path");
+                if (requestCode == AVATAR_SELECTED){
+                    Glide.with(getActivity()).load(filePath)
+                            .centerCrop()
+                            .into(avatarImg);
+                } else if (requestCode == BANNER_SELECTED){
+                    Glide.with(getActivity()).load(filePath)
+                            .centerCrop()
+                            .into(bannerImg);
+                }
+            } else {
+                //相册
+                List<PhotoInfo> photoInfoList = (List<PhotoInfo>) result.getSerializable("photo_list");
+                if (requestCode == AVATAR_SELECTED){
+                    Glide.with(getActivity())
+                            .load(photoInfoList.get(0).getFilePath())
+                            .centerCrop()
+                            .into(avatarImg);
+                } else if (requestCode == BANNER_SELECTED){
+                    Glide.with(getActivity())
+                            .load(photoInfoList.get(0).getFilePath())
+                            .centerCrop()
+                            .into(bannerImg);
+                }
+            }
+
+
+        }
+    }
+
+    private void pickImage(int requestCode){
+        PickImageHelper.PickImageOption option = new PickImageHelper.PickImageOption();
+        option.multiSelectMaxCount = 1;
+        PickImageHelper.pickImage(getContext(),requestCode,option);
+    }
+
+
 }

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