Browse Source

修改通讯录

Bitliker 7 năm trước cách đây
mục cha
commit
8675ab5099
32 tập tin đã thay đổi với 75 bổ sung33 xóa
  1. BIN
      WeiChat/src/main/res/drawable-hdpi/guanzhu.png
  2. BIN
      WeiChat/src/main/res/drawable-hdpi/phone.png
  3. BIN
      WeiChat/src/main/res/drawable-hdpi/qunliao.png
  4. BIN
      WeiChat/src/main/res/drawable-hdpi/uuhaoyou.png
  5. BIN
      WeiChat/src/main/res/drawable-mdpi/qiyetongxunlu.png
  6. BIN
      WeiChat/src/main/res/drawable-xhdpi/guanzhu.png
  7. BIN
      WeiChat/src/main/res/drawable-xhdpi/index_a.png
  8. BIN
      WeiChat/src/main/res/drawable-xhdpi/index_b.png
  9. BIN
      WeiChat/src/main/res/drawable-xhdpi/index_c.png
  10. BIN
      WeiChat/src/main/res/drawable-xhdpi/index_d.png
  11. BIN
      WeiChat/src/main/res/drawable-xhdpi/phone.png
  12. BIN
      WeiChat/src/main/res/drawable-xhdpi/qiyetongxunlu.png
  13. BIN
      WeiChat/src/main/res/drawable-xhdpi/qunliao.png
  14. BIN
      WeiChat/src/main/res/drawable-xhdpi/uuhaoyou.png
  15. BIN
      WeiChat/src/main/res/drawable-xxhdpi/guanzhu.png
  16. BIN
      WeiChat/src/main/res/drawable-xxhdpi/phone.png
  17. BIN
      WeiChat/src/main/res/drawable-xxhdpi/qiyetongxunlu.png
  18. BIN
      WeiChat/src/main/res/drawable-xxhdpi/qunliao.png
  19. BIN
      WeiChat/src/main/res/drawable-xxhdpi/uuhaoyou.png
  20. 2 1
      WeiChat/src/main/res/layout/activity_ad.xml
  21. 1 1
      WeiChat/src/main/res/layout/contact_item.xml
  22. 9 5
      WeiChat/src/main/res/layout/header_fragment_contact.xml
  23. 3 3
      WeiChat/version.properties
  24. 8 0
      app_core/common/src/main/res/drawable/selector_item_white_pass.xml
  25. 1 1
      app_core/common/src/main/res/layout/contact_item.xml
  26. 15 2
      app_core/common/src/main/res/layout/fragment_contacts.xml
  27. 1 1
      app_core/common/src/main/res/layout/header_fragment_contact.xml
  28. 1 1
      app_core/common/src/main/res/layout/item_message.xml
  29. 2 2
      app_modular/appcontact/src/main/java/com/uas/appcontact/adapter/FriendSortAdapter.java
  30. 28 15
      app_modular/appcontact/src/main/java/com/uas/appcontact/ui/fragment/ContactsFragment.java
  31. 1 1
      app_modular/appmessages/src/main/res/layout/item_message_header.xml
  32. 3 0
      app_third/library-refreshlayout/src/main/java/com/yalantis/phoenix/PullToRefreshView.java

BIN
WeiChat/src/main/res/drawable-hdpi/guanzhu.png


BIN
WeiChat/src/main/res/drawable-hdpi/phone.png


BIN
WeiChat/src/main/res/drawable-hdpi/qunliao.png


BIN
WeiChat/src/main/res/drawable-hdpi/uuhaoyou.png


BIN
WeiChat/src/main/res/drawable-mdpi/qiyetongxunlu.png


BIN
WeiChat/src/main/res/drawable-xhdpi/guanzhu.png


BIN
WeiChat/src/main/res/drawable-xhdpi/index_a.png


BIN
WeiChat/src/main/res/drawable-xhdpi/index_b.png


BIN
WeiChat/src/main/res/drawable-xhdpi/index_c.png


BIN
WeiChat/src/main/res/drawable-xhdpi/index_d.png


BIN
WeiChat/src/main/res/drawable-xhdpi/phone.png


BIN
WeiChat/src/main/res/drawable-xhdpi/qiyetongxunlu.png


BIN
WeiChat/src/main/res/drawable-xhdpi/qunliao.png


BIN
WeiChat/src/main/res/drawable-xhdpi/uuhaoyou.png


BIN
WeiChat/src/main/res/drawable-xxhdpi/guanzhu.png


BIN
WeiChat/src/main/res/drawable-xxhdpi/phone.png


BIN
WeiChat/src/main/res/drawable-xxhdpi/qiyetongxunlu.png


BIN
WeiChat/src/main/res/drawable-xxhdpi/qunliao.png


BIN
WeiChat/src/main/res/drawable-xxhdpi/uuhaoyou.png


+ 2 - 1
WeiChat/src/main/res/layout/activity_ad.xml

@@ -10,7 +10,8 @@
 
     <RelativeLayout
         android:layout_width="match_parent"
-        android:layout_height="match_parent">
+        android:layout_height="match_parent"
+        android:visibility="gone">
 
         <RadioGroup
             android:id="@+id/rg"

+ 1 - 1
WeiChat/src/main/res/layout/contact_item.xml

@@ -3,7 +3,7 @@
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:paddingBottom="10dp"
-    android:background="@drawable/selector_me_menu_item_bg"
+    android:background="@drawable/selector_item_white_pass"
     >
 
     <View

+ 9 - 5
WeiChat/src/main/res/layout/header_fragment_contact.xml

@@ -2,7 +2,7 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:background="@color/me_menu_item_normal"
+    android:background="@color/white"
     android:orientation="vertical">
 
     <com.core.widget.VoiceSearchView
@@ -23,8 +23,9 @@
             android:layout_weight="1"
             android:drawableTop="@drawable/qiyetongxunlu"
             android:gravity="center"
+            android:textColor="#333333"
             android:text="@string/contact_company"
-            android:textSize="16sp"/>
+            android:textSize="12sp"/>
 
         <TextView
             android:id="@+id/group"
@@ -33,7 +34,8 @@
             android:layout_weight="1"
             android:drawableTop="@drawable/qunliao"
             android:gravity="center"
-            android:textSize="16sp"
+            android:textSize="12sp"
+            android:textColor="#333333"
             android:text="@string/contact_business" />
 
         <RelativeLayout
@@ -47,7 +49,8 @@
                 android:drawableTop="@drawable/uuhaoyou"
                 android:gravity="center"
                 android:text="@string/contact_friend"
-                android:textSize="16sp"/>
+                android:textSize="12sp"
+                android:textColor="#333333"/>
             <TextView
                 android:id="@+id/tv_uu_new"
                 android:layout_width="10dp"
@@ -69,7 +72,8 @@
             android:drawableTop="@drawable/guanzhu"
             android:gravity="center"
             android:text="@string/contact_often"
-            android:textSize="16sp"/>
+            android:textSize="12sp"
+            android:textColor="#333333"/>
     </LinearLayout>
 
     <View

+ 3 - 3
WeiChat/version.properties

@@ -1,5 +1,5 @@
-#Thu May 03 16:08:05 CST 2018
-debugName=194
+#Thu May 03 17:54:24 CST 2018
+debugName=202
 versionName=614
-debugCode=194
+debugCode=202
 versionCode=153

+ 8 - 0
app_core/common/src/main/res/drawable/selector_item_white_pass.xml

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

+ 1 - 1
app_core/common/src/main/res/layout/contact_item.xml

@@ -3,7 +3,7 @@
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:paddingBottom="10dp"
-    android:background="@drawable/selector_me_menu_item_bg">
+    android:background="@drawable/selector_item_white_pass">
 
     <View
         android:layout_width="match_parent"

+ 15 - 2
app_core/common/src/main/res/layout/fragment_contacts.xml

@@ -9,9 +9,22 @@
         style="@style/normalListView"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:dividerHeight="@dimen/line"
+        android:background="@color/transparent"
         android:divider="@color/item_line"
-        android:background="@color/transparent" />
+        android:dividerHeight="@dimen/line"
+        android:visibility="gone" />
+
+    <com.yalantis.phoenix.PullToRefreshView
+        android:id="@+id/contact_ptrv"
+        style="@style/ListViewBasic">
+
+        <se.emilsjolander.stickylistheaders.StickyListHeadersListView
+            android:id="@+id/pull_refresh_list"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent" />
+
+    </com.yalantis.phoenix.PullToRefreshView>
+
 
     <TextView
         android:id="@+id/dialogTV"

+ 1 - 1
app_core/common/src/main/res/layout/header_fragment_contact.xml

@@ -2,7 +2,7 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
-    android:background="@color/me_menu_item_normal"
+    android:background="@color/white"
     android:orientation="vertical">
 
     <com.core.widget.VoiceSearchView

+ 1 - 1
app_core/common/src/main/res/layout/item_message.xml

@@ -2,7 +2,7 @@
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="@dimen/item_height"
-    android:background="@drawable/selector_me_menu_item_bg"
+    android:background="@drawable/selector_item_white_pass"
     android:descendantFocusability="blocksDescendants"
     android:minHeight="@dimen/item_height"
     android:paddingLeft="15dp"

+ 2 - 2
app_modular/appcontact/src/main/java/com/uas/appcontact/adapter/FriendSortAdapter.java

@@ -18,10 +18,8 @@ import com.core.model.Friend;
 import com.core.utils.helper.AvatarHelper;
 import com.core.utils.sortlist.BaseSortModel;
 import com.core.widget.crouton.Crouton;
-import com.core.xmpp.FriendHelper;
 import com.uas.appcontact.R;
 import com.uas.appcontact.db.TopContactsDao;
-import com.uas.appcontact.ui.widget.stickylistheaders.StickyListHeadersAdapter;
 
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -30,6 +28,8 @@ import java.util.Map;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
+import se.emilsjolander.stickylistheaders.StickyListHeadersAdapter;
+
 
 public class FriendSortAdapter extends BaseAdapter implements SectionIndexer,StickyListHeadersAdapter {
 

+ 28 - 15
app_modular/appcontact/src/main/java/com/uas/appcontact/ui/fragment/ContactsFragment.java

@@ -55,23 +55,29 @@ import com.uas.appcontact.ui.activity.MyFriendActivity;
 import com.uas.appcontact.ui.activity.NewFriendActivity;
 import com.uas.appcontact.ui.activity.PlatContactAddPeopleActivity;
 import com.uas.appcontact.ui.activity.UserSearchActivity;
+import com.yalantis.phoenix.PullToRefreshView;
 
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 
+import se.emilsjolander.stickylistheaders.StickyListHeadersListView;
+
 /**
  * Created by Bitliker on 2017/9/1.
  */
 
 public class ContactsFragment extends EasyFragment
         implements SideBar.OnTouchingLetterChangedListener
-        , PullToRefreshBase.OnRefreshListener<ListView>
+        , PullToRefreshView.OnRefreshListener
         , AdapterView.OnItemClickListener
         , View.OnClickListener
         , ContactsManager.OnEmployListener {
 
-    private PullToRefreshListView refreshListView;
+    private StickyListHeadersListView refreshListView;
+    private PullToRefreshView mPullToRefreshView;
+
+
     private TextView dialogTV;
     private TextView uuRedTag;
     private SideBar sidebar;
@@ -157,18 +163,18 @@ public class ContactsFragment extends EasyFragment
         showDatas = new ArrayList<>();
         allDatas = new ArrayList<>();
         userId = MyApplication.getInstance().getLoginUserId();
-        refreshListView = (PullToRefreshListView) findViewById(R.id.refreshListView);
+        refreshListView = (StickyListHeadersListView) findViewById(R.id.pull_refresh_list);
+        mPullToRefreshView = (PullToRefreshView) findViewById(R.id.contact_ptrv);
         dialogTV = (TextView) findViewById(R.id.dialogTV);
         sidebar = (SideBar) findViewById(R.id.sidebar);
         sidebar.setTextView(dialogTV);
         sidebar.setOnTouchingLetterChangedListener(this);
-        refreshListView.setMode(PullToRefreshBase.Mode.PULL_FROM_START);
-        refreshListView.setOnRefreshListener(this);
         refreshListView.setOnItemClickListener(this);
         comparator = new BaseComparator();
         initHeaderView();
         adapter = new FriendSortAdapter(ct, showDatas);
         refreshListView.setAdapter(adapter);
+        mPullToRefreshView.setOnRefreshListener(this);
         loadData();
     }
 
@@ -210,7 +216,7 @@ public class ContactsFragment extends EasyFragment
 
     private void initHeaderView() {
         View headview = LayoutInflater.from(ct).inflate(R.layout.header_fragment_contact, null);
-        refreshListView.getRefreshableView().addHeaderView(headview);
+        refreshListView.addHeaderView(headview);
         voiceSearchView = (VoiceSearchView) headview.findViewById(R.id.voiceSearchView);
         headview.findViewById(R.id.company).setOnClickListener(this);//企业结构
         headview.findViewById(R.id.group).setOnClickListener(this);//商务群
@@ -230,8 +236,8 @@ public class ContactsFragment extends EasyFragment
 
 
     void showLoading() {
-        if (refreshListView!=null) {
-            if (!refreshListView.isRefreshing() && isVisible) {
+        if (mPullToRefreshView != null) {
+            if (!mPullToRefreshView.isRefreshing() && isVisible) {
                 progressDialog.show();
             }
         }
@@ -241,9 +247,9 @@ public class ContactsFragment extends EasyFragment
         if (progressDialog != null && progressDialog.isShowing()) {
             progressDialog.dismiss();
         }
-        if (refreshListView!=null) {
-            if (refreshListView.isRefreshing()) {
-                refreshListView.onRefreshComplete();
+        if (mPullToRefreshView != null) {
+            if (mPullToRefreshView.isRefreshing()) {
+                mPullToRefreshView.setRefreshing(false);
             }
         }
     }//关闭刷新
@@ -264,10 +270,10 @@ public class ContactsFragment extends EasyFragment
         // 该字母首次出现的位置
         int position = adapter.getPositionForSection(s.charAt(0));
         if (position != -1) {
-            refreshListView.getRefreshableView().setSelection(position);
+            refreshListView.setSelection(position);
         }
         if ("↑".equals(s)) {
-            refreshListView.getRefreshableView().setSelection(0);
+            refreshListView.setSelection(0);
         }
     }
 
@@ -277,9 +283,9 @@ public class ContactsFragment extends EasyFragment
     }
 
     @Override
-    public void onRefresh(PullToRefreshBase<ListView> refreshView) {
+    public void onRefresh() {
         if ("1".equals(CommonUtil.getUserRole())) {
-            refreshListView.setRefreshing(false);
+            mPullToRefreshView.setRefreshing(false);
             dimssLoading();
         } else {
             ContactsManager.getInstance().loadContactByNet(this);
@@ -387,6 +393,7 @@ public class ContactsFragment extends EasyFragment
         OAHttpHelper.getInstance().post(new Runnable() {
             @Override
             public void run() {
+                mPullToRefreshView.setRefreshing(false);
                 if (adapter == null) return;
                 adapter.setData(showDatas);
                 dimssLoading();
@@ -394,6 +401,12 @@ public class ContactsFragment extends EasyFragment
         });
     }
 
+    @Override
+    public void onResume() {
+        super.onResume();
+        mPullToRefreshView.setRefreshing(false, false);
+    }
+
     /**
      * 将Rep转化为Friend对象
      *

+ 1 - 1
app_modular/appmessages/src/main/res/layout/item_message_header.xml

@@ -3,7 +3,7 @@
                 xmlns:app="http://schemas.android.com/apk/res-auto"
                 android:layout_width="match_parent"
                 android:layout_height="@dimen/item_height"
-                android:background="@drawable/selector_me_menu_item_bg"
+                android:background="@drawable/selector_item_white_pass"
                 android:descendantFocusability="blocksDescendants"
                 android:minHeight="@dimen/item_height"
                 android:paddingLeft="15dp"

+ 3 - 0
app_third/library-refreshlayout/src/main/java/com/yalantis/phoenix/PullToRefreshView.java

@@ -339,6 +339,9 @@ public class PullToRefreshView extends ViewGroup {
         }
     }
 
+    public boolean isRefreshing(){
+        return mRefreshing;
+    }
     public void setRefreshing(boolean refreshing, final boolean notify) {
 //        if (mRefreshing != refreshing) {
             mNotify = notify;