Fenix Wang 8 anos atrás
pai
commit
11ef2ec4be

+ 7 - 7
app/app.iml

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

+ 7 - 7
app/res/layout/team_setttins.xml

@@ -29,7 +29,7 @@
                 android:id="@+id/team_settings_room_name_layout"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:gravity="center"
+                android:gravity="center_vertical"
                 android:orientation="horizontal"
                 android:padding="16dp">
 
@@ -87,8 +87,7 @@
                 android:id="@+id/team_settings_member_count_layout"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_marginTop="16dp"
-                android:gravity="center_horizontal"
+                android:gravity="center_vertical"
                 android:orientation="horizontal"
                 android:padding="16dp">
 
@@ -142,6 +141,7 @@
             <LinearLayout
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
+                android:gravity="center_vertical"
                 android:orientation="horizontal"
                 android:padding="16dp">
 
@@ -170,6 +170,7 @@
             <LinearLayout
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
+                android:gravity="center_vertical"
                 android:orientation="horizontal"
                 android:padding="16dp">
 
@@ -199,8 +200,7 @@
                 android:id="@+id/team_settings_chat_record_layout"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_marginTop="16dp"
-                android:gravity="center_horizontal"
+                android:gravity="center_vertical"
                 android:orientation="horizontal"
                 android:padding="16dp">
 
@@ -228,8 +228,7 @@
                 android:id="@+id/team_settings_clear_chat_record_layout"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_marginTop="16dp"
-                android:gravity="center_horizontal"
+                android:gravity="center_vertical"
                 android:orientation="horizontal"
                 android:padding="16dp">
 
@@ -248,6 +247,7 @@
                 android:layout_width="128dp"
                 android:layout_height="wrap_content"
                 android:layout_gravity="center_horizontal"
+                android:layout_marginBottom="40dp"
                 android:layout_marginTop="16dp"
                 android:background="@drawable/btn1_selector"
                 android:text="退出该房间"

+ 1 - 1
app/res/values/colors.xml

@@ -76,7 +76,7 @@
     <!--谁说-->
     <!--<color name="colorPrimary">#FFAA00</color>-->
     <!--<color name="colorPrimaryDark">#d78f00</color>-->
-    <color name="colorPrimary">#fbab08</color>
+    <color name="colorPrimary">#fffbab08</color>
     <color name="colorPrimaryDark">#fbab08</color>
     <color name="colorAccent">#ff4081</color>
     <color name="white">#ffffff</color>

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

@@ -13,6 +13,7 @@ import com.bigkoo.pickerview.OptionsPickerView;
 import com.bigkoo.pickerview.lib.WheelView;
 import com.google.gson.Gson;
 import com.google.gson.reflect.TypeToken;
+import com.netease.nim.uikit.common.util.sys.ScreenUtil;
 import com.sheishuo.app.R;
 import com.sheishuo.app.cache.AccountCache;
 import com.sheishuo.app.common.beans.CityDataBean;
@@ -156,13 +157,15 @@ public class CityDataHelper {
                 .setSubmitText("保存")
                 .setDividerColor(Color.GRAY)
                 .setTextColorCenter(Color.GRAY)
-                .setContentTextSize(13)
+                .setContentTextSize(20)
+                .setTitleBgColor(Color.parseColor("#fffbab08"))
+                .setTitleColor(Color.WHITE)
+                .setCancelColor(Color.WHITE)
+                .setSubmitColor(Color.WHITE)
                 .setOutSideCancelable(false)
                 .setSelectOptions(provinceIndex, cityIndex, districtIndex)
                 .build();
 
-          /*pvOptions.setPicker(options1Items);//一级选择器
-        pvOptions.setPicker(options1Items, options2Items);//二级选择器*/
         pvOptions.setPicker(CityDataHelper.getAllProvince(), CityDataHelper.getAllCity(), CityDataHelper.getAllDistrict());//三级选择器
         View view = pvOptions.findViewById(com.bigkoo.pickerview.R.id.optionspicker);
         while(view.getParent() != null)
@@ -179,8 +182,9 @@ public class CityDataHelper {
                 }
                 else
                 {
-                    ViewGroup.LayoutParams viewLayout = view.getLayoutParams();
+                    FrameLayout.LayoutParams viewLayout = (FrameLayout.LayoutParams)view.getLayoutParams();
                     viewLayout.height = ViewGroup.LayoutParams.MATCH_PARENT;
+                    viewLayout.gravity = Gravity.CENTER_VERTICAL;
                     view.setLayoutParams(viewLayout);
                 }
             }
@@ -194,20 +198,23 @@ public class CityDataHelper {
         layoutParams.height = LinearLayout.LayoutParams.MATCH_PARENT;
         optionsPicker.setLayoutParams(layoutParams);
 
+        int screenHeight = ScreenUtil.px2dip(ScreenUtil.screenHeight);
+        int topMargin = (screenHeight - 56 - 56 - 210) / 2;
+
         View wv_option1 = optionsPicker.findViewById(com.bigkoo.pickerview.R.id.options1);// 初始化时显示的数据
         View wv_option2 = optionsPicker.findViewById(com.bigkoo.pickerview.R.id.options2);
         View wv_option3 = optionsPicker.findViewById(com.bigkoo.pickerview.R.id.options3);
 
-        ViewGroup.LayoutParams optionLayout = wv_option1.getLayoutParams();
-        optionLayout.height = ViewGroup.LayoutParams.MATCH_PARENT;
+        LinearLayout.LayoutParams optionLayout = (LinearLayout.LayoutParams)wv_option1.getLayoutParams();
+        optionLayout.topMargin = ScreenUtil.dip2px(topMargin);
         wv_option1.setLayoutParams(optionLayout);
 
-        optionLayout = wv_option2.getLayoutParams();
-        optionLayout.height = ViewGroup.LayoutParams.MATCH_PARENT;
+        optionLayout = (LinearLayout.LayoutParams)wv_option2.getLayoutParams();
+        optionLayout.topMargin = ScreenUtil.dip2px(topMargin);
         wv_option2.setLayoutParams(optionLayout);
 
-        optionLayout = wv_option3.getLayoutParams();
-        optionLayout.height = ViewGroup.LayoutParams.MATCH_PARENT;
+        optionLayout = (LinearLayout.LayoutParams)wv_option3.getLayoutParams();
+        optionLayout.topMargin = ScreenUtil.dip2px(topMargin);
         wv_option3.setLayoutParams(optionLayout);
 
         pvOptions.show();

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

@@ -50,6 +50,7 @@ import com.sheishuo.app.core_module.mine.view.ui.activity.UserInfoDetailActivity
 import com.sheishuo.app.impl.SheishuoUI;
 import com.sheishuo.app.login.LoginActivity;
 import com.sheishuo.app.session.activity.MessageHistoryActivity;
+import com.sheishuo.app.session.search.SearchMessageActivity;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -232,7 +233,8 @@ public class TeamSettingsActivity extends SheishuoUI implements View.OnClickList
         chatRecordLayout.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
-                MessageHistoryActivity.start(context,team.getId(), SessionTypeEnum.Team);
+                SearchMessageActivity.start(context, team.getId(), SessionTypeEnum.Team);
+                //MessageHistoryActivity.start(context,team.getId(), SessionTypeEnum.Team);
             }
         });
 

+ 13 - 6
app/src/com/sheishuo/app/impl/SheishuoTeamMessageActivity.java

@@ -467,12 +467,7 @@ public class SheishuoTeamMessageActivity extends TeamMessageActivity {
                 new DialogInterface.OnClickListener() {
                     @Override
                     public void onClick(DialogInterface dialog, int which) {
-                        NIMClient.getService(MsgService.class).clearChattingHistory(team.getId(), SessionTypeEnum.Team);
-                        //通知消息更新
-                        MessageListPanelHelper.getInstance().notifyClearMessages(team.getId());
-
-
-                        showToast("清除消息成功");
+                        clearHistory();
                     }
                 });
         normalDialog.setNegativeButton("取消",
@@ -486,4 +481,16 @@ public class SheishuoTeamMessageActivity extends TeamMessageActivity {
         normalDialog.show();
     }
 
+    private void clearHistory()
+    {
+        getHandler().post(new Runnable() {
+            @Override
+            public void run() {
+                NIMClient.getService(MsgService.class).clearChattingHistory(team.getId(), SessionTypeEnum.Team);
+                MessageListPanelHelper.getInstance().notifyClearMessages(team.getId());
+                showToast("清除消息成功");
+            }
+        });
+    }
+
 }

+ 17 - 25
app/src/com/sheishuo/app/main/fragment/AreaGroupsFragment.java

@@ -74,7 +74,7 @@ public class AreaGroupsFragment extends MainTabFragment implements NimLocationMa
     private LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity());
     private CustomScrollLinearLayoutManager recentLayoutManager = new CustomScrollLinearLayoutManager(getActivity());
 
-    private String location = AccountCache.getAccount().getCity() + AccountCache.getAccount().getDistrict();
+    private String location;
     private INet net = new NetImpl();
 
     @Override
@@ -101,6 +101,8 @@ public class AreaGroupsFragment extends MainTabFragment implements NimLocationMa
         initToolbar();
         loadGiftCache();
 
+        setLocationTxt(AccountCache.getAccount().getCity() + AccountCache.getAccount().getDistrict());
+
         moreAreaGroupsTV.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
@@ -147,7 +149,6 @@ public class AreaGroupsFragment extends MainTabFragment implements NimLocationMa
         });
 
         toolbarLeftTxt = new TextView(getContext());
-        toolbarLeftTxt.setText(location);
         toolbarLeftTxt.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
@@ -233,13 +234,8 @@ public class AreaGroupsFragment extends MainTabFragment implements NimLocationMa
                     @Override
                     public void run() {
                         loadGroups();
-                        location = AccountCache.getAccount().getCity()
-                                + AccountCache.getAccount().getDistrict();
-                        if (location.length() > 6) {
-                            location = location.substring(0, 6) + "...";
-                        }
-                        if(toolbarLeftTxt != null)
-                            toolbarLeftTxt.setText(location);
+                        setLocationTxt(AccountCache.getAccount().getCity()
+                                + AccountCache.getAccount().getDistrict());
                     }
                 });
             }
@@ -492,14 +488,7 @@ public class AreaGroupsFragment extends MainTabFragment implements NimLocationMa
 
 
             updateAccountLocation(province, city, area);
-
-            location = city + area;
-            if (location.length() > 6) {
-                location = location.substring(0, 6) + "...";
-            }
-
-            if(toolbarLeftTxt != null)
-                toolbarLeftTxt.setText(location);
+            setLocationTxt(city + area);
         }
     }
 
@@ -514,16 +503,19 @@ public class AreaGroupsFragment extends MainTabFragment implements NimLocationMa
                 String area = CityDataHelper.getAllDistrict().get(options1).get(options2).get(options3);
 
                 updateAccountLocation(province, city, area);
-
-                location = city + area;
-                if (location.length() > 6) {
-                    location = location.substring(0, 6) + "...";
-                }
-
-                if(toolbarLeftTxt != null)
-                    toolbarLeftTxt.setText(location);
+                setLocationTxt(city+area);
             }
         });
     }
 
+    private void setLocationTxt(String value)
+    {
+        location = value;
+        if (location.length() > 6) {
+            location = location.substring(0, 6) + "...";
+        }
+
+        if(toolbarLeftTxt != null)
+            toolbarLeftTxt.setText(location);
+    }
 }

+ 53 - 21
app/src/com/sheishuo/app/main/fragment/TradeListFragment.java

@@ -22,6 +22,7 @@ import android.widget.RadioGroup;
 import android.widget.TextView;
 import android.widget.Toast;
 
+import com.bigkoo.pickerview.OptionsPickerView;
 import com.netease.nim.uikit.common.ui.popupmenu.PopupMenuItem;
 import com.netease.nim.uikit.common.util.sys.ScreenUtil;
 import com.netease.nim.uikit.session.activity.BaseMessageActivity;
@@ -30,6 +31,7 @@ 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.location.CityDataHelper;
 import com.sheishuo.app.common.util.net.INet;
 import com.sheishuo.app.common.util.net.NetImpl;
 import com.sheishuo.app.common.util.net.ResponseCallback;
@@ -93,7 +95,7 @@ public class TradeListFragment extends MainTabFragment {
     public String priorityBeanId;
 
 
-    private String location = AccountCache.getAccount().getCity() + AccountCache.getAccount().getDistrict();
+    private String location;
     private INet net = new NetImpl();
 
     @Override
@@ -108,7 +110,6 @@ public class TradeListFragment extends MainTabFragment {
         popupWindow = new TradeSortPopupWindow(getActivity());
         findViews();
         init();
-
     }
 
 
@@ -126,6 +127,9 @@ public class TradeListFragment extends MainTabFragment {
     private void init(){
         initToolbar();
         parent.setSupportActionBar(toolbar);
+
+        setLocationTxt(AccountCache.getAccount().getCity() + AccountCache.getAccount().getDistrict());
+
         layoutManager = new LinearLayoutManager(getActivity());
         loadTradeList(TYPE_TO_LOAD, PAGE_TO_LOAD);
 
@@ -149,18 +153,19 @@ public class TradeListFragment extends MainTabFragment {
         leftIcon.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
-                Intent intent = new Intent(getActivity(), LocationSelectActivity.class);
-                startActivityForResult(intent, 0);
+//                Intent intent = new Intent(getActivity(), LocationSelectActivity.class);
+//                startActivityForResult(intent, 0);
+                showLocationSelect();
             }
         });
 
         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);
+//                Intent intent = new Intent(getActivity(), LocationSelectActivity.class);
+//                startActivityForResult(intent, 0);
+                showLocationSelect();
             }
         });
         toolbar.setLeftItems(new View[]{leftIcon, toolbarLeftTxt});
@@ -345,20 +350,20 @@ public class TradeListFragment extends MainTabFragment {
                 loadTradeList(0, 1);
             }
         }
-        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) + "...";
-            }
-
-            if(toolbarLeftTxt != null)
-                toolbarLeftTxt.setText(location);
-        }
+//        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) + "...";
+//            }
+//
+//            if(toolbarLeftTxt != null)
+//                toolbarLeftTxt.setText(location);
+//        }
     }
 
     /**
@@ -526,4 +531,31 @@ public class TradeListFragment extends MainTabFragment {
             }
         });
     }
+
+
+    private void showLocationSelect()
+    {
+        CityDataHelper.showPickerView(getContext(), new OptionsPickerView.OnOptionsSelectListener() {
+            @Override
+            public void onOptionsSelect(int options1, int options2, int options3, View v) {
+                String province = CityDataHelper.getAllProvince().get(options1);
+                String city = CityDataHelper.getAllCity().get(options1).get(options2);
+                String area = CityDataHelper.getAllDistrict().get(options1).get(options2).get(options3);
+
+                updateAccountLocation(province, city, area);
+                setLocationTxt(city+area);
+            }
+        });
+    }
+
+    private void setLocationTxt(String value)
+    {
+        location = value;
+        if (location.length() > 6) {
+            location = location.substring(0, 6) + "...";
+        }
+
+        if(toolbarLeftTxt != null)
+            toolbarLeftTxt.setText(location);
+    }
 }

+ 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" />