Browse Source

no message

Fenix Wang 8 years ago
parent
commit
fc889d350d

+ 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/intermediates/assets" />
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/builds" />

+ 233 - 21
app/res/layout/main.xml

@@ -21,40 +21,252 @@
             style="@style/fullToolbarStyle"/>
     </android.support.design.widget.AppBarLayout>
 
-    <com.sheishuo.app.common.ui.viewpager.PagerSlidingTabStrip
-        android:id="@+id/tabs"
-        android:layout_width="match_parent"
-        android:layout_height="@dimen/pager_sliding_tab_strip_height"
-        android:layout_below="@id/app_bar_layout"
-        android:background="@drawable/skin_global_bg"
-        android:visibility="gone"/>
+    <!--<com.sheishuo.app.common.ui.viewpager.PagerSlidingTabStrip-->
+        <!--android:id="@+id/tabs"-->
+        <!--android:layout_width="match_parent"-->
+        <!--android:layout_height="@dimen/pager_sliding_tab_strip_height"-->
+        <!--android:layout_below="@id/app_bar_layout"-->
+        <!--android:background="@drawable/skin_global_bg"-->
+        <!--android:visibility="gone"/>-->
 
 
-    <LinearLayout
+    <RelativeLayout
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:orientation="vertical"
-        android:layout_below="@id/tabs">
+        android:layout_below="@id/app_bar_layout">
 
         <android.support.v4.view.ViewPager
             android:id="@+id/main_tab_pager"
             android:layout_width="match_parent"
-            android:layout_weight="9"
-            android:layout_height="0dp"
-            android:layout_below="@id/tabs"/>
+            android:layout_height="match_parent"
+            android:layout_marginBottom="@dimen/action_bar_height">
+
+        </android.support.v4.view.ViewPager>
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:gravity="bottom"
+            android:orientation="vertical">
+
+            <RelativeLayout
+                android:layout_width="match_parent"
+                android:layout_height="1dp"
+                android:layout_gravity="bottom"
+                android:background="@color/grey_light_light">
+
+            </RelativeLayout>
+
+            <LinearLayout
+                android:id="@+id/bottom_tab_container"
+                android:layout_width="match_parent"
+                android:layout_height="@dimen/action_bar_height"
+                android:layout_gravity="bottom"
+                android:background="@color/GreyWhite"
+                android:orientation="horizontal">
+
+                <RelativeLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent"
+                    android:layout_marginBottom="2dp"
+                    android:layout_marginTop="4dp"
+                    android:layout_weight="1"
+                    android:background="@color/GreyWhite"
+                    android:gravity="center"
+                    android:orientation="vertical">
+
+                    <ImageView
+                        android:layout_width="match_parent"
+                        android:layout_height="26dp"
+                        app:srcCompat="@drawable/_01_unchecked" />
+
+                    <TextView
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:layout_marginTop="30dp"
+                        android:layout_weight="2"
+                        android:text="谁说"
+                        android:textAlignment="center"
+                        android:textSize="11sp" />
+
+                    <com.netease.nim.uikit.common.ui.drop.DropFake
+                        android:layout_width="28dip"
+                        android:layout_height="28dip"
+                        android:layout_gravity="center_horizontal|center"
+                        android:textColor="@android:color/white"
+                        android:textSize="12sp"
+                        android:visibility="gone" />
+
+                    <Button
+                        android:layout_width="match_parent"
+                        android:layout_height="match_parent"
+                        android:background="@null" />
+
+                </RelativeLayout>
+
+                <RelativeLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent"
+                    android:layout_marginBottom="2dp"
+                    android:layout_marginTop="4dp"
+                    android:layout_weight="1"
+                    android:background="@color/GreyWhite"
+                    android:gravity="center"
+                    android:orientation="vertical">
+
+                    <ImageView
+                        android:layout_width="match_parent"
+                        android:layout_height="26dp"
+                        app:srcCompat="@drawable/_01_unchecked" />
+
+                    <TextView
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:layout_marginTop="30dp"
+                        android:layout_weight="2"
+                        android:text="朋友"
+                        android:textAlignment="center"
+                        android:textSize="11sp" />
+
+                    <LinearLayout
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:layout_marginLeft="28dip"
+                        android:gravity="center_horizontal"
+                        android:orientation="horizontal">
+
+                        <com.netease.nim.uikit.common.ui.drop.DropFake
+                            android:layout_width="28dip"
+                            android:layout_height="28dip"
+                            android:textColor="@android:color/white"
+                            android:textSize="12sp"
+                            android:visibility="gone" />
+                    </LinearLayout>
+
+                    <Button
+                        android:layout_width="match_parent"
+                        android:layout_height="match_parent"
+                        android:background="@null" />
+
+                </RelativeLayout>
+
+                <RelativeLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent"
+                    android:layout_marginBottom="2dp"
+                    android:layout_marginTop="4dp"
+                    android:layout_weight="1"
+                    android:background="@color/GreyWhite"
+                    android:orientation="vertical">
+
+                    <ImageView
+                        android:layout_width="match_parent"
+                        android:layout_height="26dp"
+                        app:srcCompat="@drawable/_01_unchecked" />
+
+                    <TextView
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:layout_marginTop="30dp"
+                        android:layout_weight="2"
+                        android:text="快讯"
+                        android:textAlignment="center"
+                        android:textSize="11sp" />
+
+                    <com.netease.nim.uikit.common.ui.drop.DropFake
+                        android:layout_width="28dip"
+                        android:layout_height="28dip"
+                        android:textColor="@android:color/white"
+                        android:textSize="12sp"
+                        android:visibility="gone" />
+
+                    <Button
+                        android:layout_width="match_parent"
+                        android:layout_height="match_parent"
+                        android:background="@null" />
+
+                </RelativeLayout>
+
+                <RelativeLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent"
+                    android:layout_marginBottom="2dp"
+                    android:layout_marginTop="4dp"
+                    android:layout_weight="1"
+                    android:background="@color/GreyWhite"
+                    android:orientation="vertical">
+
+                    <ImageView
+                        android:layout_width="match_parent"
+                        android:layout_height="26dp"
+                        app:srcCompat="@drawable/_01_unchecked" />
+
+                    <TextView
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:layout_marginTop="30dp"
+                        android:layout_weight="2"
+                        android:text="动态"
+                        android:textAlignment="center"
+                        android:textSize="11sp" />
+
+                    <com.netease.nim.uikit.common.ui.drop.DropFake
+                        android:layout_width="28dip"
+                        android:layout_height="28dip"
+                        android:textColor="@android:color/white"
+                        android:textSize="12sp"
+                        android:visibility="gone" />
+
+                    <Button
+                        android:layout_width="match_parent"
+                        android:layout_height="match_parent"
+                        android:background="@null" />
+
+                </RelativeLayout>
+
+                <RelativeLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent"
+                    android:layout_marginBottom="2dp"
+                    android:layout_marginTop="4dp"
+                    android:layout_weight="1"
+                    android:background="@color/GreyWhite"
+                    android:orientation="vertical">
+
+                    <ImageView
+                        android:layout_width="match_parent"
+                        android:layout_height="26dp"
+                        app:srcCompat="@drawable/_01_unchecked" />
+
+                    <TextView
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:layout_marginTop="30dp"
+                        android:layout_weight="2"
+                        android:text="我的"
+                        android:textAlignment="center"
+                        android:textSize="11sp" />
+
+                    <com.netease.nim.uikit.common.ui.drop.DropFake
+                        android:layout_width="28dip"
+                        android:layout_height="28dip"
+                        android:textColor="@android:color/white"
+                        android:textSize="12sp"
+                        android:visibility="gone" />
+
+                    <Button
+                        android:layout_width="match_parent"
+                        android:layout_height="match_parent"
+                        android:background="@null" />
 
+                </RelativeLayout>
+            </LinearLayout>
+        </LinearLayout>
 
-        <com.sheishuo.app.common.views.BottomNavigationViewEx
-            android:id="@+id/main_navigationbar"
-            android:layout_width="wrap_content"
-            android:layout_height="0dp"
-            android:layout_weight="1"
-            android:background="?android:attr/windowBackground"
-            android:layout_gravity="bottom"
-            app:menu="@menu/main_botton_navi_menu" />
 
+    </RelativeLayout>
 
-    </LinearLayout>
     <com.netease.nim.uikit.common.ui.drop.DropCover
         android:id="@+id/unread_cover"
         android:layout_width="match_parent"

+ 9 - 8
app/res/layout/tab_layout_main.xml

@@ -1,10 +1,10 @@
 <?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="@drawable/background_tab"
-              android:gravity="center"
-              android:orientation="horizontal">
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:background="@drawable/background_tab"
+    android:gravity="center"
+    android:orientation="horizontal">
 
     <TextView
         android:id="@+id/tab_title_label"
@@ -12,7 +12,7 @@
         android:layout_height="wrap_content"
         android:layout_gravity="center_vertical"
         android:textColor="@color/action_bar_tittle_color_555555"
-        android:textSize="15sp"/>
+        android:textSize="15sp" />
 
     <ImageView
         android:id="@+id/tab_new_indicator"
@@ -21,7 +21,7 @@
         android:layout_gravity="center_vertical"
         android:contentDescription="@string/empty"
         android:src="@drawable/nim_main_tab_new_message_notify"
-        android:visibility="gone"/>
+        android:visibility="gone" />
 
     <com.netease.nim.uikit.common.ui.drop.DropFake
         android:id="@+id/tab_new_msg_label"
@@ -31,5 +31,6 @@
         android:gravity="center"
         android:textColor="@android:color/white"
         android:textSize="12sp"
-        android:visibility="gone"/>
+        android:visibility="visible" />
+
 </LinearLayout>

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

@@ -27,8 +27,6 @@
             android:id="@+id/trade_list_recyclerview"
             android:layout_width="match_parent"
             android:layout_height="match_parent"
-            android:paddingLeft="8dp"
-            android:paddingRight="8dp"
             tools:layout_editor_absoluteX="8dp"
             tools:layout_editor_absoluteY="8dp" />
     </LinearLayout>

+ 156 - 82
app/res/layout/trade_list_item.xml

@@ -1,6 +1,7 @@
 <?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"
+    xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:orientation="vertical"
@@ -11,110 +12,183 @@
 
 
 
-    <android.support.constraint.ConstraintLayout
+    <LinearLayout
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:padding="8dp">
-
-        <com.netease.nim.uikit.common.ui.imageview.HeadImageView
-            android:id="@+id/trade_list_item_avatar"
-            android:layout_width="48dp"
-            android:layout_height="48dp"
-            app:layout_constraintTop_toTopOf="parent"
-            android:layout_marginTop="16dp"
-            android:layout_marginLeft="16dp"
-            app:layout_constraintLeft_toLeftOf="parent"
-            android:src="@drawable/logo"
-            android:layout_marginStart="16dp" />
-
-        <ImageView
-            android:id="@+id/trade_list_item_follow_img"
-            android:layout_width="32dp"
-            android:layout_height="32dp"
-            android:src="@drawable/trade_unfollowed"
-            app:layout_constraintTop_toTopOf="parent"
-            android:layout_marginTop="16dp"
-            android:layout_marginRight="16dp"
-            app:layout_constraintRight_toRightOf="parent" />
-
-        <TextView
-            android:id="@+id/trade_list_item_name"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="用户名"
-            app:layout_constraintLeft_toRightOf="@+id/trade_list_item_avatar"
-            android:layout_marginLeft="8dp"
-            app:layout_constraintTop_toTopOf="parent"
-            android:layout_marginTop="16dp"
-            android:layout_marginStart="8dp" />
-
-        <TextView
-            android:id="@+id/trade_list_item_date"
-            android:layout_width="wrap_content"
+        android:orientation="vertical">
+
+        <RelativeLayout
+            android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:layout_marginTop="8dp"
-            android:text="发布时间"
-            app:layout_constraintLeft_toLeftOf="@+id/trade_list_item_name"
-            app:layout_constraintTop_toBottomOf="@+id/trade_list_item_name" />
+            android:orientation="horizontal"
+            android:padding="10dp">
+
+            <com.netease.nim.uikit.common.ui.imageview.HeadImageView
+                android:id="@+id/trade_list_item_avatar"
+                android:layout_width="48dp"
+                android:layout_height="48dp"
+                android:src="@drawable/logo" />
+
+            <LinearLayout
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_gravity="left"
+                android:layout_marginLeft="54dp"
+                android:layout_marginTop="5dp"
+                android:orientation="vertical">
+
+                <TextView
+                    android:id="@+id/trade_list_item_name"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:text="用户名"
+                    android:textColor="@color/blue"
+                    app:layout_constraintLeft_toRightOf="@+id/trade_list_item_avatar"
+                    app:layout_constraintTop_toTopOf="parent" />
+
+                <TextView
+                    android:id="@+id/trade_list_item_date"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="4dp"
+                    android:text="发布时间"
+                    app:layout_constraintLeft_toLeftOf="@+id/trade_list_item_name"
+                    app:layout_constraintTop_toBottomOf="@+id/trade_list_item_name" />
+
+            </LinearLayout>
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:gravity="right"
+                android:orientation="horizontal">
+
+                <LinearLayout
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:gravity="center"
+                    android:orientation="vertical">
+
+                    <ImageView
+                        android:id="@+id/trade_list_item_follow_img"
+                        android:layout_width="24dp"
+                        android:layout_height="24dp"
+                        android:layout_weight="1"
+                        android:src="@drawable/trade_unfollowed"
+                        android:visibility="visible" />
+
+                    <TextView
+                        android:id="@+id/trade_list_item_follow_txt"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="1"
+                        android:text="关注"
+                        android:textSize="12sp"
+                        android:visibility="visible" />
+
+                </LinearLayout>
+
+                <TextView
+                    android:id="@+id/trade_list_item_modify"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginRight="8dp"
+                    android:layout_marginTop="8dp"
+                    android:text="修改"/>
+
+            </LinearLayout>
+
+
+        </RelativeLayout>
+
 
         <com.sheishuo.app.common.views.PartlyHighLightTextView
             android:id="@+id/trade_list_item_content"
-            android:layout_width="0dp"
+            android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:layout_marginLeft="16dp"
-            android:layout_marginRight="16dp"
-            android:layout_marginTop="16dp"
-            android:layout_marginStart="16dp"
-            android:layout_marginEnd="16dp"
+            android:paddingLeft="10dp"
+            android:paddingRight="10dp"
             android:text="这里是交易内容详情这里是交易内容详情这里是交易内容详情这里是交易内容详情
                         这里是交易内容详情这里是交易内容详情这里是交易内容详情这里是交易内容详情"
+            app:highlight_color="@color/green_4DC0A4"
+            app:hightlight_str=""
+            app:layout_constraintHorizontal_bias="1.0"
             app:layout_constraintLeft_toLeftOf="parent"
             app:layout_constraintRight_toRightOf="parent"
-            app:layout_constraintTop_toBottomOf="@+id/trade_list_item_avatar"
-            app:layout_constraintHorizontal_bias="1.0"
-            app:hightlight_str=""
-            app:highlight_color="@color/green_4DC0A4"
-            />
+            app:layout_constraintTop_toBottomOf="@+id/trade_list_item_avatar" />
 
         <com.sheishuo.app.common.views.ImgGridView
             android:id="@+id/trade_list_item_imgs_gridview"
-            android:layout_width="0dp"
+            android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:numColumns="2"
+            android:paddingBottom="5dp"
+            android:paddingLeft="10dp"
+            android:paddingRight="10dp"
+            android:paddingTop="5dp"
+            android:scrollbarDefaultDelayBeforeFade="0"
+            app:layout_constraintHorizontal_bias="0.0"
             app:layout_constraintLeft_toLeftOf="@+id/trade_list_item_content"
-            app:layout_constraintTop_toBottomOf="@+id/trade_list_item_content"
             app:layout_constraintRight_toRightOf="@+id/trade_list_item_content"
-            app:layout_constraintHorizontal_bias="0.0"
-            android:scrollbarDefaultDelayBeforeFade="0"
-            android:padding="16dp"/>
+            app:layout_constraintTop_toBottomOf="@+id/trade_list_item_content" />
 
-        <TextView
-            android:id="@+id/trade_list_item_priority"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="置顶101"
-            android:textColor="@color/green_4DC0A4"
-            android:background="@drawable/style_rounded_corner_editext"
-            android:padding="4dp"
-            android:layout_marginLeft="0dp"
-            app:layout_constraintLeft_toLeftOf="@+id/trade_list_item_imgs_gridview"
-            android:layout_marginTop="8dp"
-            app:layout_constraintTop_toBottomOf="@+id/trade_list_item_imgs_gridview" />
-        <TextView
-            android:id="@+id/trade_list_item_views"
-            android:layout_width="wrap_content"
+        <RelativeLayout
+            android:layout_width="match_parent"
             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"
-            app:layout_constraintTop_toBottomOf="@+id/trade_list_item_imgs_gridview" />
-    </android.support.constraint.ConstraintLayout>
+            android:paddingBottom="5dp"
+            android:paddingLeft="10dp"
+            android:paddingRight="10dp"
+            android:paddingTop="5dp">
+
+            <TextView
+                android:id="@+id/trade_list_item_priority"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:background="@drawable/style_rounded_corner_editext"
+                android:paddingBottom="4dp"
+                android:paddingLeft="10dp"
+                android:paddingRight="10dp"
+                android:paddingTop="4dp"
+                android:text="置顶101"
+                android:textColor="@color/green_4DC0A4"
+                app:layout_constraintLeft_toLeftOf="@+id/trade_list_item_imgs_gridview"
+                app:layout_constraintTop_toBottomOf="@+id/trade_list_item_imgs_gridview" />
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="5dp"
+                android:gravity="right"
+                android:orientation="horizontal">
+
+                <TextView
+                    android:id="@+id/trade_list_item_delete"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginRight="8dp"
+                    android:text="删除" />
+
+                <TextView
+                    android:id="@+id/trade_list_item_views"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginRight="0dp"
+                    android:layout_marginTop="8dp"
+                    android:padding="4dp"
+                    android:text="阅读103"
+                    android:visibility="gone"
+                    app:layout_constraintRight_toRightOf="@+id/trade_list_item_imgs_gridview"
+                    app:layout_constraintTop_toBottomOf="@+id/trade_list_item_imgs_gridview" />
+
+            </LinearLayout>
+
+        </RelativeLayout>
+
+    </LinearLayout>
 
     <View
         android:layout_width="match_parent"
         android:layout_height="1dp"
-        android:background="@color/grey_light"/>
+        android:layout_marginTop="10dp"
+        android:background="@color/grey_light" />
 </LinearLayout>

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

@@ -26,6 +26,7 @@ public interface INet {
     void getGiftList(ResponseCallback callback);
     void uploadImgs(String filePath, ResponseCallback callback);
     void uploadSocialPhoto(String filePath,ResponseCallback callback);
+    void deleteSocialPhoto(String id, ResponseCallback callback);
     void getSocialInfo(String targetID,ResponseCallback callback);
     void getCityDataList(ResponseCallback callback);
     void getNearbyPeople(String userId,String page,ResponseCallback callback);
@@ -33,6 +34,7 @@ public interface INet {
     void getTradeList(int type,int page,ResponseCallback callback);
     void searchTrade(String key,int type,int page,ResponseCallback callback);
     void publishTrade(int type,String content,String pics,int priority,int priorityType,String roomId,ResponseCallback callback);
+    void deleteTrade(String tradeId, ResponseCallback callback);
     void newComment(int socialId, @Nullable int replyId, String comment, ResponseCallback callback);
     void updateBanner(String filePath,ResponseCallback callback);
     void getPhoneContactRelationship(String phoneListStr,ResponseCallback callback);

+ 75 - 2
app/src/com/sheishuo/app/common/util/net/NetImpl.java

@@ -12,6 +12,7 @@ import com.sheishuo.app.common.beans.CircleBean;
 import com.sheishuo.app.common.beans.ContactRelationshipBean;
 import com.sheishuo.app.common.beans.GiftBean;
 import com.sheishuo.app.common.beans.SocialInfoBean;
+import com.sheishuo.app.common.beans.SocialPhoto;
 import com.sheishuo.app.common.beans.TradeBean;
 import com.sheishuo.app.common.util.location.LocationHelper;
 import com.sheishuo.app.login.beans.LoginBean;
@@ -225,6 +226,7 @@ public class NetImpl implements INet {
 
                     if (200 == response.code()) {
                         LoginBean bean = gson.fromJson(response.body().string(), LoginBean.class);
+                        bean.getD().setAutoJoinRoom(true);
                         switch (bean.getC()) {
                             case 0:
                                 callback.onSuccess(bean);
@@ -423,8 +425,15 @@ public class NetImpl implements INet {
                     String resultStr = response.body().string();
                     Log.e("resultStr",resultStr);
                     JSONObject jsonObject = new JSONObject(resultStr);
-                    if (jsonObject.getInt("c") == 0) {
-                        callback.onSuccess(null);
+                    if (jsonObject.getInt("c") == 0)
+                    {
+                        JSONObject data = jsonObject.getJSONObject("d");
+                        SocialPhoto photo = new SocialPhoto();
+                        photo.setAid(data.getString("id"));
+                        photo.setUser_id(AccountCache.getAccount().getId());
+                        photo.setThumb(data.getString("thumb"));
+                        photo.setPic(data.getString("pic"));
+                        callback.onSuccess(photo);
                     } else {
                         callback.onFailed();
                     }
@@ -436,6 +445,33 @@ public class NetImpl implements INet {
         });
     }
 
+    @Override
+    public void deleteSocialPhoto(final String id, final ResponseCallback callback)
+    {
+        new Thread(new Runnable() {
+            @Override
+            public void run() {
+                FormBody body = new FormBody.Builder()
+                        .add("id", id)
+                        .build();
+                Request request = new Request.Builder()
+                        .url(NetInfo.DELETE_SOCIAL_PHOTO)
+                        .post(body)
+                        .build();
+                try {
+                    Response response = client.newCall(request).execute();
+                    if (200 == response.code()) {
+                        callback.onSuccess(null);
+                    } else {
+                        callback.onFailed();
+                    }
+                } catch (IOException e) {
+                    e.printStackTrace();
+                    callback.onFailed();
+                }
+            }
+        }).start();
+    }
 
     @Override
     public void getSocialInfo(final String targetID, final ResponseCallback callback) {
@@ -694,6 +730,43 @@ public class NetImpl implements INet {
 
 
     @Override
+    public void deleteTrade(final String tradeId, final ResponseCallback callback)
+    {
+        new Thread(new Runnable() {
+            @Override
+            public void run() {
+                FormBody body = new FormBody.Builder()
+                        .add("id", tradeId)
+                        .build();
+
+                Request request = new Request.Builder()
+                        .post(body)
+                        .url(DELETE_TRADE)
+                        .build();
+
+                Response response = null;
+                try {
+                    response = client.newCall(request).execute();
+                    if (200 == response.code()){
+                        String resultJson = response.body().string();
+                        callback.onSuccess(resultJson);
+                    }else {
+                        callback.onFailed();
+                    }
+                } catch (Exception e) {
+                    e.printStackTrace();
+                    callback.onFailed();
+                }
+
+
+
+
+
+            }
+        }).start();
+    }
+
+    @Override
     public void newComment(final int socialId, @Nullable final int replyId, final String comment, final ResponseCallback callback) {
         new Thread(new Runnable() {
             @Override

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

@@ -17,6 +17,7 @@ public class NetInfo {
     public final static String GET_CODE = INDEX + "?m=who&c=index&a=send_code";
     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 DELETE_SOCIAL_PHOTO = INDEX + "?m=who&c=social&a=photo_delete";
     public final static String TRADE_LIST = INDEX + "?m=who&c=trade&a=lists";
     public final static String TRADE_EDIT = INDEX + "?m=who&c=trade&a=edit";
     public final static String FOLLOW_TRADE = INDEX + "?m=who&c=trade&a=follow";
@@ -27,6 +28,7 @@ public class NetInfo {
     public final static String UPDATE_LATITUDE_AND_LONGITUDE = INDEX + "?m=who&c=index&a=coordinate_2_location";
     public final static String NEARBY_PEOPLE = INDEX + "?m=who&c=index&a=near_user";
     public final static String NEW_TRADE = INDEX + "?m=who&c=trade&a=publish";
+    public final static String DELETE_TRADE = INDEX + "?m=who&c=trade&a=delete";
     public final static String CONTACTS_RELATIONSHIP = INDEX + "?m=who&c=social&a=contact";
     public final static String TRADE_SEARCH = INDEX + "?m=who&c=trade&a=search";
     public final static String CIRCLE_COMMENT = INDEX + "?m=who&c=social&a=comment";

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

@@ -96,6 +96,11 @@ public class BaseToolbar extends Toolbar {
 
     public void setLeftItems(View[] views)
     {
+        for(int i=0; i<leftLayout.getChildCount(); i++)
+        {
+            leftLayout.getChildAt(i).setOnClickListener(null);
+        }
+
         leftLayout.removeAllViewsInLayout();
 
         for(int i=0; i<views.length; i++)
@@ -124,6 +129,11 @@ public class BaseToolbar extends Toolbar {
 
     public void setRightItems(View[] views)
     {
+        for(int i=0; i<rightLayout.getChildCount(); i++)
+        {
+            rightLayout.getChildAt(i).setOnClickListener(null);
+        }
+
         rightLayout.removeAllViewsInLayout();
 
         for(int i=0; i<views.length; i++)

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

@@ -12,6 +12,7 @@ import android.view.View;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.TextView;
+import android.widget.Toast;
 
 import com.sheishuo.app.R;
 import com.sheishuo.app.cache.AccountCache;
@@ -37,7 +38,7 @@ public class MineTradeActivity extends SheishuoUI {
     private String TAG = this.getClass().getSimpleName();
     private TradePresenter presenter;
     private Context context = this;
-
+    private Toast toast;
     private BaseToolbar toolbar;
 
     private TabLayout tabLayout;
@@ -183,13 +184,13 @@ public class MineTradeActivity extends SheishuoUI {
                         String id;
                         if ((id = (String) view.getTag(R.drawable.trade_unfollowed)) != null){
                             Log.e("ID","点击之前未关注");
-                            //presenter.followTrade(id);
+                            presenter.followTrade(id);
                         }else if ((id = (String) view.getTag(R.drawable.trade_followed)) != null){
                             Log.e("ID","点击之前已关注关注");
-                            //presenter.unfollowTrade(id);
+                            presenter.unfollowTrade(id);
                         }
 
-                    }else if (view instanceof TextView){
+                    }else if (view.getId() == R.id.trade_list_item_priority || view.getId() == R.id.trade_list_item_modify){
                         priorityTV = (TextView) view;
                         priorityBeanId = (String) view.getTag(R.id.flag_trade_id);
                         String userId = (String) view.getTag(R.id.user_account);
@@ -203,7 +204,16 @@ public class MineTradeActivity extends SheishuoUI {
                             intent.putExtras(data);
                             startActivityForResult(intent, TradeChangePriorityActivity.TRADE_CHANGE_PRIORITY);
                         }
-                    }else {
+                    }
+                    else if(view.getId() == R.id.trade_list_item_delete)
+                    {
+                        String userId = (String) view.getTag(R.id.user_account);
+                        if(userId.equals(AccountCache.getAccount().getId())) {
+                            priorityBeanId = (String) view.getTag(R.id.flag_trade_id);
+                            presenter.deleteTrade(priorityBeanId);
+                        }
+                    }
+                    else {
                         Log.e(TAG,"未识别View");
                     }
 
@@ -214,13 +224,60 @@ public class MineTradeActivity extends SheishuoUI {
 
     public void onPriorityUpdate(final String tradeId, final String priority)
     {
-        getHandler().postDelayed(new Runnable() {
+        getHandler().post(new Runnable() {
             @Override
             public void run() {
                 if(adapter != null)
                     adapter.updateTradePriority(tradeId, priority);
             }
-        }, 100);
+        });
+
+    }
 
+    public void showToast(final String str){
+        getHandler().post(new Runnable() {
+            @Override
+            public void run() {
+                if (toast == null){
+                    toast = Toast.makeText(getBaseContext(),str,Toast.LENGTH_SHORT);
+                }else {
+                    toast.setText(str);
+                }
+
+                toast.show();
+            }
+        });
+    }
+
+    public void onFollowTradeSuccess(final String id){
+        getHandler().post(new Runnable() {
+            @Override
+            public void run() {
+                showToast("关注成功");
+                adapter.setFollowed(id);
+            }
+        });
+    }
+
+
+    public void onUnfollowTradeSuccess(final String id){
+        getHandler().post(new Runnable() {
+            @Override
+            public void run() {
+                showToast("取消关注成功");
+                adapter.setUnfollowed(id);
+            }
+        });
+    }
+
+    public void onTradeDelete(final String tradeId)
+    {
+        getHandler().post(new Runnable() {
+            @Override
+            public void run() {
+                if(adapter != null)
+                    adapter.deleteTrade(tradeId);
+            }
+        });
     }
 }

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

@@ -11,13 +11,18 @@ import android.widget.GridLayout;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.TextView;
+import android.widget.Toast;
 
 import com.bumptech.glide.Glide;
 import com.netease.nim.uikit.common.media.picker.PickImageHelper;
 import com.netease.nim.uikit.common.media.picker.activity.PickImageActivity;
 import com.netease.nim.uikit.common.media.picker.activity.PickerAlbumActivity;
 import com.netease.nim.uikit.common.media.picker.model.PhotoInfo;
+import com.netease.nim.uikit.common.ui.dialog.CustomAlertDialog;
 import com.netease.nim.uikit.session.activity.WatchPictureActivity;
+import com.netease.nimlib.sdk.NIMClient;
+import com.netease.nimlib.sdk.msg.SystemMessageService;
+import com.netease.nimlib.sdk.msg.model.SystemMessage;
 import com.sheishuo.app.R;
 import com.sheishuo.app.cache.AccountCache;
 import com.sheishuo.app.cache.SocialInfoCache;
@@ -28,6 +33,7 @@ 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.impl.SheishuoUI;
+import com.sheishuo.app.main.activity.SystemMessageActivity;
 
 import org.w3c.dom.Text;
 
@@ -111,6 +117,9 @@ public class MineUploadPhotoActivity extends SheishuoUI {
         getHandler().post(new Runnable() {
             @Override
             public void run() {
+
+                gridLayout.removeAllViewsInLayout();
+
                 final List<SocialPhoto> photos = SocialInfoCache.get(mineId).getPhotos();
 
 
@@ -137,6 +146,13 @@ public class MineUploadPhotoActivity extends SheishuoUI {
                         }
                     });
 
+                    imageView.setOnLongClickListener(new View.OnLongClickListener() {
+                        @Override
+                        public boolean onLongClick(View v) {
+                            showLongClickMenu(photos.get(finalI));
+                            return false;
+                        }
+                    });
 
                     gridLayout.addView(imageView);
                 }
@@ -188,22 +204,13 @@ public class MineUploadPhotoActivity extends SheishuoUI {
                 @Override
                 public void onSuccess(Object object) {
 
+                    final SocialPhoto photo = (SocialPhoto)object;
+                    SocialInfoCache.get(AccountCache.getAccount().getId()).getPhotos().add(photo);
+
                     getHandler().post(new Runnable() {
                         @Override
                         public void run() {
-                            //移除占位按钮
-                            gridLayout.removeViewAt(gridLayout.getChildCount() - 1);
-                            showToast(context,"第" + finalI + 1 + "上传成功");
-                            int widthAndHeight = ImgUtil.getScreenWidth(context) / 3;
-                            ImageView imageView = ImgUtil.createImageView(context,widthAndHeight,widthAndHeight);
-                            Glide.with(context)
-                                    .load(photos.get(finalI).getAbsolutePath())
-                                    .centerCrop()
-                                    .into(imageView);
-                            gridLayout.addView(imageView);
-
-                            //重新添加占位按钮
-                            createAddPhotoBtn();
+                            initPhotosWall(AccountCache.getAccount().getId());
 
                             //解锁完成按钮
                             toolbarRightTxt.setText("完成");
@@ -242,4 +249,43 @@ public class MineUploadPhotoActivity extends SheishuoUI {
         });
         gridLayout.addView(addPhotoBtn);
     }
+
+
+
+
+
+    private void showLongClickMenu(final SocialPhoto photo) {
+        CustomAlertDialog alertDialog = new CustomAlertDialog(this);
+        alertDialog.setTitle("删除提示");
+        alertDialog.addItem("是否删除该图片?", new CustomAlertDialog.onSeparateItemClickListener() {
+            @Override
+            public void onClick() {
+                deletePhoto(photo);
+            }
+        });
+        alertDialog.show();
+    }
+
+    private void deletePhoto(final SocialPhoto photo) {
+        net.deleteSocialPhoto(photo.getId(), new ResponseCallback() {
+            @Override
+            public void onSuccess(Object object) {
+
+                getHandler().post(new Runnable() {
+                    @Override
+                    public void run() {
+
+                        SocialInfoCache.get(AccountCache.getAccount().getId()).getPhotos().remove(photo);
+                        initPhotosWall(AccountCache.getAccount().getId());
+                    }
+                });
+
+            }
+
+            @Override
+            public void onFailed() {
+                showToast(context,"删除失败");
+            }
+        });
+    }
 }

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

@@ -244,4 +244,30 @@ public class TradeModel {
             }
         }).start();
     }
+
+
+    public void deleteTrade(final String id)
+    {
+        final FormBody body = new FormBody.Builder()
+                .add("id", id)
+                .build();
+
+        new Thread(new Runnable() {
+            @Override
+            public void run() {
+                net.post(NetInfo.DELETE_TRADE, body, new ResponseCallback() {
+                    @Override
+                    public void onSuccess(Object object) {
+                        String json = (String)object;
+                        presenter.onTradeDelete(id);
+                    }
+
+                    @Override
+                    public void onFailed() {
+                        presenter.showToast("加载失败,请检查网络");
+                    }
+                });
+            }
+        }).start();
+    }
 }

+ 53 - 7
app/src/com/sheishuo/app/core_module/trade/presenter/TradePresenter.java

@@ -1,5 +1,13 @@
 package com.sheishuo.app.core_module.trade.presenter;
 
+import android.content.Context;
+import android.content.DialogInterface;
+import android.support.v7.app.AlertDialog;
+
+import com.netease.nim.uikit.session.helper.MessageListPanelHelper;
+import com.netease.nimlib.sdk.NIMClient;
+import com.netease.nimlib.sdk.msg.MsgService;
+import com.netease.nimlib.sdk.msg.constant.SessionTypeEnum;
 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;
@@ -56,17 +64,18 @@ public class TradePresenter {
         model.unfollowTrade(id);
     }
     public void onFollowTradeSuccess(String id){
-        fragment.onFollowTradeSuccess(id);
+        if(fragment != null) fragment.onFollowTradeSuccess(id);
+        if(mineTradeActivity != null) mineTradeActivity.onFollowTradeSuccess(id);
     }
     public void onUnfollowTradeSuccess(String id){
-        fragment.onUnfollowTradeSuccess(id);
+        if(fragment != null) fragment.onUnfollowTradeSuccess(id);
+        if(mineTradeActivity != null) mineTradeActivity.onUnfollowTradeSuccess(id);
     }
+
     public void showToast(String str){
-        if (fragment != null){
-            fragment.showToast(str);
-        }else {
-            activity.showToast(activity,str);
-        }
+        if (fragment != null) fragment.showToast(str);
+        if (activity != null) activity.showToast(activity,str);
+        if (mineTradeActivity != null) mineTradeActivity.showToast(str);
     }
 
 
@@ -103,4 +112,41 @@ public class TradePresenter {
         if(mineTradeActivity != null) mineTradeActivity.onPriorityUpdate(tradeId, priority);
         if(fragment != null) fragment.onPriorityUpdate(tradeId, priority);
     }
+
+
+    public void deleteTrade(final String tradeId)
+    {
+        Context context = null;
+        if(fragment != null)
+            context = fragment.getContext();
+        else if(mineTradeActivity != null)
+            context = mineTradeActivity;
+
+        final AlertDialog.Builder normalDialog =
+                new AlertDialog.Builder(context);
+        normalDialog.setTitle("删除提示");
+        normalDialog.setMessage("确定删除该快讯?");
+        normalDialog.setPositiveButton("确定",
+                new DialogInterface.OnClickListener() {
+                    @Override
+                    public void onClick(DialogInterface dialog, int which) {
+                        model.deleteTrade(tradeId);
+                    }
+                });
+        normalDialog.setNegativeButton("取消",
+                new DialogInterface.OnClickListener() {
+                    @Override
+                    public void onClick(DialogInterface dialog, int which) {
+
+                    }
+                });
+        // 显示
+        normalDialog.show();
+    }
+
+    public void onTradeDelete(String tradeId)
+    {
+        if(fragment != null) fragment.onTradeDelete(tradeId);
+        if(mineTradeActivity != null) mineTradeActivity.onTradeDelete(tradeId);
+    }
 }

+ 52 - 9
app/src/com/sheishuo/app/core_module/trade/view/adapter/TradeItemAdapter.java

@@ -124,7 +124,6 @@ public class TradeItemAdapter extends RecyclerView.Adapter<TradeItemAdapter.Trad
         //设置置顶权限
         if (bean.getPriority() != null && Integer.valueOf(bean.getPriority()) > 0) {
             holder.priority.setText("置顶x" + bean.getPriority());
-
         }
 
 
@@ -138,16 +137,47 @@ public class TradeItemAdapter extends RecyclerView.Adapter<TradeItemAdapter.Trad
         holder.priority.setTag(R.id.user_account, bean.getUser_id());
 
 
-        //判断是否已加关注
-        if (1 == bean.getFollow()) {
-            Glide.with(context).load(R.drawable.trade_followed).into(holder.followImg);
-            holder.followImg.setTag(R.drawable.trade_followed, bean.getId());
-            holder.followImg.setOnClickListener(this);
-        } else {
-            holder.followImg.setTag(R.drawable.trade_unfollowed, bean.getId());
+        if (bean.getUser_id().equals(AccountCache.getAccount().getId())) {
+            holder.modify.setTag(R.id.user_account, bean.getUser_id());
+            holder.modify.setTag(R.id.flag_trade_id, bean.getId());
+            holder.modify.setTag(R.id.flag_trade_priority, bean.getPriority());
+            holder.modify.setTag(R.id.flag_trade_priority_type, bean.getPriority_type());
+            holder.modify.setOnClickListener(this);
+            holder.modify.setVisibility(View.VISIBLE);
+
+
+            holder.followImg.setVisibility(View.GONE);
+            holder.followTxt.setVisibility(View.GONE);
+
+            holder.deleteTxt.setVisibility(View.VISIBLE);
+            holder.deleteTxt.setTag(R.id.user_account, bean.getUser_id());
+            holder.deleteTxt.setTag(R.id.flag_trade_id, bean.getId());
+            holder.deleteTxt.setOnClickListener(this);
+        }
+        else
+        {
+            holder.modify.setVisibility(View.GONE);
+
+            //判断是否已加关注
+            if (1 == bean.getFollow()) {
+                Glide.with(context).load(R.drawable.trade_followed).into(holder.followImg);
+                holder.followImg.setTag(R.drawable.trade_followed, bean.getId());
+                holder.followTxt.setText("已关注");
+            } else {
+                holder.followImg.setTag(R.drawable.trade_unfollowed, bean.getId());
+                holder.followTxt.setText("关注");
+            }
             holder.followImg.setOnClickListener(this);
+            holder.followTxt.setOnClickListener(this);
+            holder.followImg.setVisibility(View.VISIBLE);
+            holder.followTxt.setVisibility(View.VISIBLE);
+            holder.deleteTxt.setVisibility(View.GONE);
         }
 
+
+
+
+
         //设置浏览量
         holder.review.setText("浏览" + bean.getReview());
 
@@ -294,10 +324,20 @@ public class TradeItemAdapter extends RecyclerView.Adapter<TradeItemAdapter.Trad
         }
     }
 
+    public void deleteTrade(String id) {
+        for (TradeBean.DBean.ListBean bean : data) {
+            if (bean.getId().equals(id)) {
+                data.remove(bean);
+                notifyDataSetChanged();
+                break;
+            }
+        }
+    }
+
     class TradeItemViewHolder extends RecyclerView.ViewHolder {
         private LinearLayout layout;
         private ImageView avatarImg, followImg;
-        private TextView userName, date, priority, review;
+        private TextView userName, date, priority, review, modify, followTxt, deleteTxt;
         private PartlyHighLightTextView content;
         private ImgGridView imgGridView;
 
@@ -306,12 +346,15 @@ public class TradeItemAdapter extends RecyclerView.Adapter<TradeItemAdapter.Trad
             layout = (LinearLayout) view.findViewById(R.id.trade_list_item_layout);
             avatarImg = (ImageView) view.findViewById(R.id.trade_list_item_avatar);
             followImg = (ImageView) view.findViewById(R.id.trade_list_item_follow_img);
+            followTxt = (TextView) view.findViewById(R.id.trade_list_item_follow_txt);
             userName = (TextView) view.findViewById(R.id.trade_list_item_name);
             date = (TextView) view.findViewById(R.id.trade_list_item_date);
             content = (PartlyHighLightTextView) view.findViewById(R.id.trade_list_item_content);
             priority = (TextView) view.findViewById(R.id.trade_list_item_priority);
             review = (TextView) view.findViewById(R.id.trade_list_item_views);
             imgGridView = (ImgGridView) view.findViewById(R.id.trade_list_item_imgs_gridview);
+            modify = (TextView) view.findViewById(R.id.trade_list_item_modify);
+            deleteTxt = (TextView) view.findViewById(R.id.trade_list_item_delete);
         }
     }
 

+ 4 - 2
app/src/com/sheishuo/app/event/OnlineStateEventManager.java

@@ -434,7 +434,9 @@ public class OnlineStateEventManager {
      * 允许在线状态事件,开发者开通在线状态后修改此处直接返回true
      */
     public static boolean enableOnlineStateEvent() {
-        String packageName = SheishuoCache.getContext().getPackageName();
-        return enable = (packageName != null && packageName.equals("com.sheishuo.app"));
+        return enable;
+
+        //String packageName = SheishuoCache.getContext().getPackageName();
+        //return enable = (packageName != null && packageName.equals("com.sheishuo.app"));
     }
 }

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

@@ -68,6 +68,7 @@ public class LoginBean {
         private String city_room_id;
         private String district_room_id;
         private List<TradePriorityBean> trade_priority;
+        private boolean autoJoinRoom;
 
         public String getId() {
             return id;
@@ -244,5 +245,17 @@ public class LoginBean {
                 this.inputtime = inputtime;
             }
         }
+
+        public boolean getAutoJoinRoom()
+        {
+            return this.autoJoinRoom;
+        }
+
+        public void setAutoJoinRoom(boolean value)
+        {
+            this.autoJoinRoom = value;
+        }
     }
+
+
 }

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

@@ -220,7 +220,10 @@ public class AreaGroupsFragment extends MainTabFragment {
 
 
         //自动打开地区群
-        SheishuoUIKit.startTeamSession(getActivity(), groupIds.get(groupIds.size() - 1));
+        if(AccountCache.getAccount().getAutoJoinRoom()) {
+            SheishuoUIKit.startTeamSession(getActivity(), groupIds.get(groupIds.size() - 1));
+            AccountCache.getAccount().setAutoJoinRoom(false);
+        }
 
 
         //加载附近的群

+ 98 - 54
app/src/com/sheishuo/app/main/fragment/HomeFragment.java

@@ -3,6 +3,8 @@ package com.sheishuo.app.main.fragment;
 import android.app.Activity;
 import android.content.Context;
 import android.content.Intent;
+import android.graphics.Color;
+import android.graphics.drawable.Drawable;
 import android.os.Bundle;
 import android.support.annotation.NonNull;
 import android.support.design.widget.BottomNavigationView;
@@ -15,9 +17,14 @@ import android.view.LayoutInflater;
 import android.view.MenuItem;
 import android.view.View;
 import android.view.ViewGroup;
+import android.widget.Button;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
 
 import com.netease.nim.uikit.common.fragment.TFragment;
 import com.netease.nim.uikit.common.ui.drop.DropCover;
+import com.netease.nim.uikit.common.ui.drop.DropFake;
 import com.netease.nim.uikit.common.ui.drop.DropManager;
 import com.netease.nim.uikit.common.util.log.LogUtil;
 import com.netease.nim.uikit.contact_selector.activity.ContactSelectActivity;
@@ -56,8 +63,6 @@ public class HomeFragment extends TFragment implements OnPageChangeListener, Rem
 
     private String TAG = this.getClass().getSimpleName();
 
-    private PagerSlidingTabStrip tabs;
-
     private ViewPager pager;
 
     private Toolbar toolbar;
@@ -68,7 +73,7 @@ public class HomeFragment extends TFragment implements OnPageChangeListener, Rem
 
     private View rootView;
 
-    private BottomNavigationViewEx navigationView;
+    private LinearLayout bottomTabContainer;
 
     private List<Integer> navigationbarItemList = new ArrayList<>();
 
@@ -90,7 +95,6 @@ public class HomeFragment extends TFragment implements OnPageChangeListener, Rem
         findViews();
         initBottomNavigationView();
         setupPager();
-        setupTabs();
         registerMsgUnreadInfoObserver(true);
         registerSystemMessageObservers(true);
         requestSystemMessageUnreadCount();
@@ -133,34 +137,68 @@ public class HomeFragment extends TFragment implements OnPageChangeListener, Rem
         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) {
-            navigationView.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() {
-                @Override
-                public boolean onNavigationItemSelected(@NonNull MenuItem item) {
-                    for (int position = 0; position < navigationbarItemList.size(); position++) {
 
-                        if (navigationbarItemList.get(position) == item.getItemId()) {
-                            pager.setCurrentItem(position);
-                        }
-                    }
-                    return true;
+        for(int i=0; i<bottomTabContainer.getChildCount(); i++)
+        {
+            ViewGroup itemLayout = (ViewGroup) bottomTabContainer.getChildAt(i);
+            Button btn = (Button) itemLayout.getChildAt(itemLayout.getChildCount()-1);
+            btn.setTag(i);
+            btn.setOnClickListener(new View.OnClickListener() {
+                @Override
+                public void onClick(View v) {
+                    int index = (int) v.getTag();
+                    pager.setCurrentItem(index);
+                    setBottomSelectedAt(index);
                 }
             });
         }
 
+    }
 
-        //设置BottomNavigationViewEx
-        navigationView.enableAnimation(false);
-        navigationView.enableShiftingMode(false);
-        navigationView.enableItemShiftingMode(false);
+    private void setBottomSelectedAt(int index)
+    {
+        for(int i=0; i<bottomTabContainer.getChildCount(); i++)
+        {
+            ViewGroup itemLayout = (ViewGroup) bottomTabContainer.getChildAt(i);
+            int drawable = 0;
+            int color = i == index ? Color.parseColor("#FFFBAB08") : Color.parseColor("lightgrey");
+            switch(i)
+            {
+                case 0:
+                    drawable = i == index ? R.drawable._01_checked : R.drawable._01_unchecked;
+                    break;
+                case 1:
+                    drawable = i == index ? R.drawable._02_checked : R.drawable._02_unchecked;
+                    break;
+                case 2:
+                    drawable = i == index ? R.drawable._03_checked : R.drawable._03_unchecked;
+                    break;
+                case 3:
+                    drawable = i == index ? R.drawable._04_checked : R.drawable._04_unchecked;
+                    break;
+                case 4:
+                    drawable = i == index ? R.drawable._05_checked : R.drawable._05_unchecked;
+                    break;
+            }
 
+            for(int j=0; j<itemLayout.getChildCount(); j++)
+            {
+                View view = itemLayout.getChildAt(j);
+                if(view instanceof ImageView)
+                {
+                    ((ImageView) view).setImageResource(drawable);
+                }
+                else if(view instanceof TextView)
+                {
+                    ((TextView) view).setTextColor(color);
+                }
+            }
+        }
     }
 
 
     @Override
     public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
-        // TO TABS
-        tabs.onPageScrolled(position, positionOffset, positionOffsetPixels);
 
         // TO ADAPTER
         adapter.onPageScrolled(position);
@@ -169,13 +207,9 @@ public class HomeFragment extends TFragment implements OnPageChangeListener, Rem
 
     @Override
     public void onPageSelected(int position) {
-        // TO TABS
-        tabs.onPageSelected(position);
-
         selectPage(position);
 
-
-        navigationView.setSelectedItemId(navigationbarItemList.get(position));
+        setBottomSelectedAt(position);
         enableMsgNotification(false);
     }
 
@@ -187,8 +221,6 @@ public class HomeFragment extends TFragment implements OnPageChangeListener, Rem
 
     @Override
     public void onPageScrollStateChanged(int state) {
-        // TO TABS
-        tabs.onPageScrollStateChanged(state);
 
         scrollState = state;
 
@@ -212,9 +244,8 @@ public class HomeFragment extends TFragment implements OnPageChangeListener, Rem
      */
     private void findViews() {
         toolbar = findView(R.id.toolbar);
-        tabs = findView(R.id.tabs);
         pager = findView(R.id.main_tab_pager);
-        navigationView = findView(R.id.main_navigationbar);
+        bottomTabContainer = findView(R.id.bottom_tab_container);
 
         //将Toolbar传递给MainActivity
         setToolBar(toolbar);
@@ -272,26 +303,6 @@ public class HomeFragment extends TFragment implements OnPageChangeListener, Rem
         pager.setOnPageChangeListener(this);
     }
 
-    /**
-     * 设置tab条目
-     */
-    private void setupTabs() {
-
-        tabs.setOnCustomTabListener(new PagerSlidingTabStrip.OnCustomTabListener() {
-            @Override
-            public int getTabLayoutResId(int position) {
-                return R.layout.tab_layout_main;
-            }
-
-            @Override
-            public boolean screenAdaptation() {
-                return true;
-            }
-        });
-        tabs.setViewPager(pager);
-        tabs.setOnTabClickListener(adapter);
-        tabs.setOnTabDoubleTapListener(adapter);
-    }
 
     private void enableMsgNotification(boolean enable) {
         boolean msg = (pager.getCurrentItem() != MainTab.RECENT_CONTACTS.tabIndex);
@@ -326,8 +337,38 @@ public class HomeFragment extends TFragment implements OnPageChangeListener, Rem
     @Override
     public void onUnreadNumChanged(ReminderItem item) {
         MainTab tab = MainTab.fromReminderId(item.getId());
-        if (tab != null) {
-            tabs.updateTab(tab.tabIndex, item);
+//        if (tab != null) {
+//            tabs.updateTab(tab.tabIndex, item);
+//        }
+
+        if(tab == null || tab.tabIndex < 0 || tab.tabIndex >= navigationbarItemList.size())
+            return;
+
+        ViewGroup itemLayout = (ViewGroup) bottomTabContainer.getChildAt(tab.tabIndex);
+        int unread = item.getUnread();
+        for(int i=0; i<itemLayout.getChildCount(); i++)
+        {
+            View view = itemLayout.getChildAt(i);
+            if(view instanceof DropFake)
+            {
+                view.setVisibility(unread > 0 ? View.VISIBLE : View.GONE);
+                ((DropFake) view).setText(""+item.getUnread());
+                break;
+            }
+            else if(view instanceof ViewGroup)
+            {
+                ViewGroup group = (ViewGroup) view;
+                for(int j=0; j<group.getChildCount(); j++)
+                {
+                    view = group.getChildAt(j);
+                    if(view instanceof DropFake)
+                    {
+                        view.setVisibility(unread > 0 ? View.VISIBLE : View.GONE);
+                        ((DropFake) view).setText(""+item.getUnread());
+                        break;
+                    }
+                }
+            }
         }
     }
 
@@ -345,7 +386,8 @@ public class HomeFragment extends TFragment implements OnPageChangeListener, Rem
         @Override
         public void onEvent(Integer unreadCount) {
             SystemMessageUnreadManager.getInstance().setSysMsgUnreadCount(unreadCount);
-            ReminderManager.getInstance().updateContactUnreadNum(unreadCount);
+            int unreadMsg = NIMClient.getService(MsgService.class).getTotalUnreadCount();
+            ReminderManager.getInstance().updateContactUnreadNum(unreadCount+unreadMsg);
         }
     };
 
@@ -355,7 +397,8 @@ public class HomeFragment extends TFragment implements OnPageChangeListener, Rem
     private void requestSystemMessageUnreadCount() {
         int unread = NIMClient.getService(SystemMessageService.class).querySystemMessageUnreadCountBlock();
         SystemMessageUnreadManager.getInstance().setSysMsgUnreadCount(unread);
-        ReminderManager.getInstance().updateContactUnreadNum(unread);
+        int unreadMsg = NIMClient.getService(MsgService.class).getTotalUnreadCount();
+        ReminderManager.getInstance().updateContactUnreadNum(unread+unreadMsg);
     }
 
     /**
@@ -439,8 +482,9 @@ public class HomeFragment extends TFragment implements OnPageChangeListener, Rem
             //位置选择
             case LocationSelectActivity.LOCATION_SELECTED_RESULT_CODE:
                 for (Fragment fragment : getFragmentManager().getFragments()) {
-                    if (fragment instanceof AreaGroupsFragment)
+                    if (fragment instanceof AreaGroupsFragment || fragment instanceof  TradeListFragment) {
                         fragment.onActivityResult(requestCode, resultCode, data);
+                    }
                 }
                 break;
 

+ 147 - 7
app/src/com/sheishuo/app/main/fragment/TradeListFragment.java

@@ -30,7 +30,11 @@ import com.sheishuo.app.R;
 import com.sheishuo.app.SheishuoCache;
 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.location.LocationSelectActivity;
 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;
@@ -42,6 +46,9 @@ import com.sheishuo.app.core_module.trade.view.ui.activity.TradePublishActivity;
 import com.sheishuo.app.core_module.trade.view.ui.activity.TradeSearchActivity;
 import com.sheishuo.app.main.activity.MainActivity;
 
+import org.json.JSONException;
+import org.json.JSONObject;
+
 import java.util.ArrayList;
 import java.util.List;
 
@@ -73,6 +80,7 @@ public class TradeListFragment extends MainTabFragment {
     private FloatingActionButton fab;
     private TradeSortPopupWindow popupWindow;
     private TextView sortTxt;
+    private TextView toolbarLeftTxt;
 
     /**
      * FLAGS
@@ -83,6 +91,10 @@ public class TradeListFragment extends MainTabFragment {
     public TextView priorityTV = null;
     public String priorityBeanId;
 
+
+    private String location = AccountCache.getAccount().getCity() + AccountCache.getAccount().getDistrict();
+    private INet net = new NetImpl();
+
     @Override
     public void onCreate(@Nullable Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
@@ -114,7 +126,7 @@ public class TradeListFragment extends MainTabFragment {
         initToolbar();
         parent.setSupportActionBar(toolbar);
         layoutManager = new LinearLayoutManager(getActivity());
-        loadTradeList(TYPE_TO_LOAD,PAGE_TO_LOAD);
+        loadTradeList(TYPE_TO_LOAD, PAGE_TO_LOAD);
 
 
         fab.setOnClickListener(new View.OnClickListener() {
@@ -130,6 +142,28 @@ public class TradeListFragment extends MainTabFragment {
         toolbar.setVisibility(View.VISIBLE);
         toolbar.setTitle("快讯");
 
+
+        ImageView leftIcon = new ImageView(getContext());
+        leftIcon.setImageResource(R.drawable.location_white);
+        leftIcon.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                Intent intent = new Intent(getActivity(), LocationSelectActivity.class);
+                startActivityForResult(intent, 0);
+            }
+        });
+
+        toolbarLeftTxt = new TextView(getContext());
+        toolbarLeftTxt.setText(location);
+        toolbarLeftTxt.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                Intent intent = new Intent(getActivity(), LocationSelectActivity.class);
+                startActivityForResult(intent, 0);
+            }
+        });
+        toolbar.setLeftItems(new View[]{leftIcon, toolbarLeftTxt});
+
         ImageView searchIcon = new ImageView(getContext());
         searchIcon.setBackgroundResource(R.drawable.ic_action_search);
         ViewGroup.LayoutParams lp = new ViewGroup.LayoutParams(ScreenUtil.dip2px(30), ScreenUtil.dip2px(30));
@@ -152,7 +186,6 @@ public class TradeListFragment extends MainTabFragment {
         });
 
         toolbar.setRightItems(new View[]{searchIcon, sortTxt});
-        toolbar.setLeftItems(new View[0]);
     }
 
     private void showPopup()
@@ -184,6 +217,8 @@ public class TradeListFragment extends MainTabFragment {
 
 
     public void loadTradeList(int type,int page){
+        TYPE_TO_LOAD = type;
+        PAGE_TO_LOAD = page;
         presenter.loadTradeList(type,page);
     }
 
@@ -203,7 +238,7 @@ public class TradeListFragment extends MainTabFragment {
                     {
                         UserInfoDetailActivity.start(getContext(), (String) view.getTag(R.id.user_account));
                     }
-                    else if (view instanceof ImageView){
+                    else if (view.getId() == R.id.trade_list_item_follow_img || view.getId() == R.id.trade_list_item_follow_txt){
 
                         String id;
                         if ((id = (String) view.getTag(R.drawable.trade_unfollowed)) != null){
@@ -215,7 +250,7 @@ public class TradeListFragment extends MainTabFragment {
                         }
 
                     }
-                    else if (view.getId() == R.id.trade_list_item_priority){
+                    else if (view.getId() == R.id.trade_list_item_priority || view.getId() == R.id.trade_list_item_modify){
 
                         String userId = (String) view.getTag(R.id.user_account);
                         if(userId.equals(AccountCache.getAccount().getId())) {
@@ -231,7 +266,17 @@ public class TradeListFragment extends MainTabFragment {
                             startActivityForResult(intent, TradeChangePriorityActivity.TRADE_CHANGE_PRIORITY);
                         }
 
-                    }else {
+                    }
+                    else if(view.getId() == R.id.trade_list_item_delete)
+                    {
+                        String userId = (String) view.getTag(R.id.user_account);
+                        if(userId.equals(AccountCache.getAccount().getId())) {
+                            priorityBeanId = (String) view.getTag(R.id.flag_trade_id);
+                            presenter.deleteTrade(priorityBeanId);
+                        }
+
+                    }
+                    else {
                         Log.e(TAG,"未识别View");
                     }
 
@@ -268,6 +313,19 @@ public class TradeListFragment extends MainTabFragment {
                 adapter.addAll((TradeBean) data.getSerializableExtra(TradeSearchActivity.RESULT_CONTENT));
             }
         }
+        else if (LocationSelectActivity.LOCATION_SELECTED_RESULT_CODE == resultCode) {
+            String province = data.getExtras().getString(LocationSelectActivity.LOCATION_PROVINCE);
+            String city = data.getExtras().getString(LocationSelectActivity.LOCATION_CITY);
+            String area = data.getExtras().getString(LocationSelectActivity.LOCATION_AREA);
+            updateAccountLocation(province, city, area);
+
+            location = city + area;
+            if (location.length() > 6) {
+                location = location.substring(0, 6) + "...";
+            }
+
+            toolbarLeftTxt.setText(location);
+        }
     }
 
     /**
@@ -344,12 +402,94 @@ public class TradeListFragment extends MainTabFragment {
 
     public void onPriorityUpdate(final String tradeId, final String priority)
     {
-        getHandler().postDelayed(new Runnable() {
+        handler.post(new Runnable() {
             @Override
             public void run() {
                 if(adapter != null)
                     adapter.updateTradePriority(tradeId, priority);
             }
-        }, 100);
+        });
+    }
+
+    public void onTradeDelete(final String tradeId)
+    {
+        handler.post(new Runnable() {
+            @Override
+            public void run() {
+                if(adapter != null)
+                    adapter.deleteTrade(tradeId);
+            }
+        });
+    }
+
+
+
+
+    //更新地理位置
+    public void updateLocation() {
+        net.updateLatitudeAndLongitude(new ResponseCallback() {
+            @Override
+            public void onSuccess(Object object) {
+                getHandler().post(new Runnable() {
+                    @Override
+                    public void run() {
+                        loadTradeList(TYPE_TO_LOAD, 1);
+                        location = AccountCache.getAccount().getCity()
+                                + AccountCache.getAccount().getDistrict();
+                        if (location.length() > 6) {
+                            location = location.substring(0, 6) + "...";
+                        }
+
+                        toolbarLeftTxt.setText(location);
+                    }
+                });
+            }
+
+            @Override
+            public void onFailed() {
+                showToast("更新地理位置失败,请检查定位权限");
+            }
+        });
+    }
+
+    public void updateAccountLocation(final String province, final String city, final String district) {
+        //更新Cache
+        AccountCache.getAccount().setProvince(province);
+        AccountCache.getAccount().setCity(city);
+        AccountCache.getAccount().setDistrict(district);
+
+        net.updateLocation(province, city, district, new ResponseCallback() {
+            @Override
+            public void onSuccess(Object object) {
+                String jsonStr = (String) object;
+                try {
+                    JSONObject jsonObject = new JSONObject(jsonStr);
+
+                    String provinceRoomId = jsonObject.getJSONObject("d").getString("province");
+                    String cityRoomId = jsonObject.getJSONObject("d").getString("city");
+                    String districtRoomId = jsonObject.getJSONObject("d").getString("district");
+
+                    AccountCache.getAccount().setProvince_room_id(provinceRoomId);
+                    AccountCache.getAccount().setCity_room_id(cityRoomId);
+                    AccountCache.getAccount().setDistrict_room_id(districtRoomId);
+
+                    getHandler().post(new Runnable() {
+                        @Override
+                        public void run() {
+                            loadTradeList(TYPE_TO_LOAD, 1);
+                        }
+                    });
+
+                } catch (JSONException e) {
+                    e.printStackTrace();
+                }
+
+            }
+
+            @Override
+            public void onFailed() {
+
+            }
+        });
     }
 }

+ 1 - 1
app/src/com/sheishuo/app/main/model/MainTab.java

@@ -12,7 +12,7 @@ import com.sheishuo.app.main.fragment.ContactListFragment;
 import com.sheishuo.app.main.fragment.MainTabFragment;
 
 public enum MainTab {
-    AREA_GROUPS(0,ReminderId.CONTACT, AreaGroupsFragment.class,R.string.main_tab_groups,R.layout.area_groups_list_fragment),
+    AREA_GROUPS(0,ReminderId.INVALID, AreaGroupsFragment.class,R.string.main_tab_groups,R.layout.area_groups_list_fragment),
     RECENT_CONTACTS(1, ReminderId.SESSION, SessionListFragment.class, R.string.main_tab_session, R.layout.session_list),
 //    CHAT_ROOM(2, ReminderId.INVALID, ChatRoomListFragment.class, R.string.chat_room, R.layout.chat_room_tab),
     TRADE(2,ReminderId.INVALID, TradeListFragment.class,R.string.main_tab_trade,R.layout.trade_list_fragment),

+ 4 - 2
uikit/src/com/netease/nim/uikit/common/ui/drop/DropFake.java

@@ -33,7 +33,7 @@ public class DropFake extends View {
         void onUp();
     }
 
-    private int radius; // 圆形半径
+    private int radius = DropManager.CIRCLE_RADIUS; // 圆形半径
     private float circleX; // 圆心x坐标
     private float circleY; // 圆心y坐标
     private String text; // 要显示的文本(数字)
@@ -42,12 +42,13 @@ public class DropFake extends View {
 
     public DropFake(Context context, AttributeSet attrs) {
         super(context, attrs);
-
         DropManager.getInstance().initPaint();
     }
 
     @Override
     protected void onSizeChanged(int w, int h, int oldw, int oldh) {
+        boolean visiable = getVisibility() == View.VISIBLE;
+        String str = text;
         super.onSizeChanged(w, h, oldw, oldh);
         if (firstInit) {
             firstInit = false;
@@ -110,6 +111,7 @@ public class DropFake extends View {
 
     public void setText(String text) {
         this.text = text;
+        boolean visiable = getVisibility() == View.VISIBLE;
         invalidate();
     }
 

+ 7 - 7
uikit/uikit.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/annotations" />
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />