Exemplo n.º 1
0
  @Override
  public View getSectionHeaderView(int section, View convertView, ViewGroup parent) {
    if (usersAsSections) {
      if (section < ContactsController.getInstance().sortedUsersSectionsArray.size()) {
        if (convertView == null) {
          convertView = new SettingsSectionLayout(mContext);
          convertView.setBackgroundColor(0xffffffff);
        }
        ((SettingsSectionLayout) convertView)
            .setText(ContactsController.getInstance().sortedUsersSectionsArray.get(section));
        return convertView;
      }
    } else {
      if (section == 0) {
        if (convertView == null) {
          LayoutInflater li =
              (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          convertView = li.inflate(R.layout.empty_layout, parent, false);
        }
        return convertView;
      }
    }

    if (convertView == null) {
      convertView = new SettingsSectionLayout(mContext);
      convertView.setBackgroundColor(0xffffffff);
    }
    ((SettingsSectionLayout) convertView)
        .setText(ContactsController.getInstance().sortedContactsSectionsArray.get(section - 1));
    return convertView;
  }
Exemplo n.º 2
0
 @Override
 public View getSectionHeaderView(int section, View convertView, ViewGroup parent) {
   if (convertView == null) {
     convertView = new SettingsSectionLayout(mContext);
     convertView.setBackgroundColor(0xffffffff);
   }
   if (searching && searchWas) {
     ((SettingsSectionLayout) convertView)
         .setText(LocaleController.getString("AllContacts", R.string.AllContacts));
   } else {
     ((SettingsSectionLayout) convertView)
         .setText(ContactsController.getInstance().sortedUsersSectionsArray.get(section));
   }
   return convertView;
 }