Example #1
0
 @Override
 public int getItemViewType(int position) {
   TreeNode node = getItem(position);
   if (node != null) {
     if (node.getType() == TreeNode.LAYER) return ITEM_LAYER;
     if (node.getType() == TreeNode.PROTOCOL) return ITEM_PROTOCOL;
     if (node.getType() == TreeNode.GROUP) return ITEM_GROUP;
     if (node.getType() == TreeNode.CONTACT) return ITEM_CONTACT;
   }
   return -1;
 }
Example #2
0
 public boolean isEnabled(int position) {
   TreeNode node = items.get(position);
   if (node.getType() == TreeNode.LAYER) return false;
   return true;
 }