Пример #1
0
  @Override
  protected void onStart() {
    super.onStart();

    myAllItems.clear();

    final Intent intent = getIntent();

    myAllItems.add(new SectionItem("enabled"));
    final List<String> enabledIds =
        intent.getStringArrayListExtra(NetworkLibraryActivity.ENABLED_CATALOG_IDS_KEY);
    if (enabledIds.size() > 0) {
      final TreeSet<CatalogItem> cItems = new TreeSet<CatalogItem>();
      for (String id : enabledIds) {
        final NetworkTree tree = NetworkLibrary.Instance().getCatalogTreeByUrlAll(id);
        if (tree != null && tree.getLink() != null) {
          cItems.add(new CatalogItem(id, true, tree));
        }
      }
      myAllItems.addAll(cItems);
      mySelectedItems.addAll(cItems);
    }

    myAllItems.add(new SectionItem("disabled"));
    final List<String> disabledIds =
        intent.getStringArrayListExtra(NetworkLibraryActivity.DISABLED_CATALOG_IDS_KEY);
    if (disabledIds.size() > 0) {
      final TreeSet<CatalogItem> cItems = new TreeSet<CatalogItem>();
      for (String id : disabledIds) {
        cItems.add(
            new CatalogItem(id, false, NetworkLibrary.Instance().getCatalogTreeByUrlAll(id)));
      }
      myAllItems.addAll(cItems);
    }

    setListAdapter(new CatalogsListAdapter());
  }
Пример #2
0
 public String getTitle() {
   return Tree.getLink().getTitle();
 }
Пример #3
0
 @Override
 public void removeItems(Set<NetworkLibraryItem> items) {
   ChildrenItems.removeAll(items);
   super.removeItems(items);
 }