private void initAdapter() {
    IContactDataProvider dataProvider = new ContactDataProvider(ItemTypes.FRIEND);

    adapter =
        new ContactDataAdapter(getActivity(), new ContactsGroupStrategy(), dataProvider) {
          @Override
          protected List<AbsContactItem> onNonDataItems() {
            if (customization != null) {
              return customization.onGetFuncItems();
            }

            return new ArrayList<>();
          }

          @Override
          protected void onPreReady() {
            loadingFrame.setVisibility(View.VISIBLE);
          }

          @Override
          protected void onPostLoad(boolean empty, String queryText, boolean all) {
            loadingFrame.setVisibility(View.GONE);
            int userCount = NimUIKit.getContactProvider().getMyFriendsCount();
            countView.setText("共有好友" + userCount + "名");
          }
        };

    adapter.addViewHolder(ItemTypes.LABEL, LabelHolder.class);
    if (customization != null) {
      adapter.addViewHolder(ItemTypes.FUNC, customization.onGetFuncViewHolderClass());
    }
    adapter.addViewHolder(ItemTypes.FRIEND, ContactHolder.class);
  }
  public void refresh() {
    reloadChange(true);

    if (adapter != null) {
      adapter.notifyDataSetChanged();
    }
  }
  private void buildLitterIdx(View view) {
    LetterIndexView livIndex = (LetterIndexView) view.findViewById(R.id.liv_index);
    livIndex.setNormalColor(getResources().getColor(R.color.contacts_letters_color));
    ImageView imgBackLetter = (ImageView) view.findViewById(R.id.img_hit_letter);
    TextView litterHit = (TextView) view.findViewById(R.id.tv_hit_letter);
    litterIdx = adapter.createLivIndex(listView, livIndex, litterHit, imgBackLetter);

    litterIdx.show();
  }
  /** 加载本地数据(已从服务器下载到本地),切换到当前tab时触发 */
  public void reloadChange(boolean rebuild) {
    if (adapter == null) {
      if (getActivity() == null) {
        return;
      }

      initAdapter();
    }

    adapter.load(rebuild);
  }