Пример #1
0
  void populateFromGroup(RosterItemView rosterItemView, Group g) {
    Group group = g;
    g = RosterHelper.getInstance().getGroupWithContacts(g);
    if (g == null) g = group;
    rosterItemView.itemNameColor = Scheme.getColor(R.attr.group);
    rosterItemView.itemNameFont = Typeface.DEFAULT;
    rosterItemView.itemName = g.getText();

    rosterItemView.itemFirstImage =
        new Icon(g.isExpanded() ? SawimResources.groupDownIcon : SawimResources.groupRightIcons)
            .getImage()
            .getBitmap();

    Drawable messIcon = ChatHistory.instance.getUnreadMessageIcon(g.getContacts());
    if (messIcon != null) {
      if (messIcon == SawimResources.PERSONAL_MESSAGE_ICON) {
        messIcon = messIcon.getConstantState().newDrawable();
        messIcon.setColorFilter(
            Scheme.getColor(R.attr.personal_unread_message), PorterDuff.Mode.MULTIPLY);
      } else {
        messIcon = messIcon.getConstantState().newDrawable();
        messIcon.setColorFilter(Scheme.getColor(R.attr.unread_message), PorterDuff.Mode.MULTIPLY);
      }
    }
    if (!g.isExpanded() && messIcon != null) rosterItemView.itemFifthImage = messIcon;
  }
Пример #2
0
 public static Group copyGroupWithoutContacts(Group g) {
   Group newGroup = new Group(g.getText());
   newGroup.setGroupId(g.getGroupId());
   newGroup.setMode(g.getMode());
   newGroup.setExpandFlag(g.isExpanded());
   return newGroup;
 }