Android Open Source - ingress-key-counter Portal List






From Project

Back to project page ingress-key-counter.

License

The source code is released under:

MIT License

If you think the Android project ingress-key-counter listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package de.lehrbaum.keycounter;
//  w w  w  .ja va2  s  .c om
import android.content.Context;

/**
 * This list encapsulates a list of portals and updates changes to the database.
 */
public class PortalList extends AbstractEncapsuledList<Portal> {
  protected Category cat;
  
  public PortalList(Context c, Category cat) {
    this(new DatabaseHandler(c), cat);
  }
  
  public PortalList(DatabaseHandler dh, Category cat) {
    super(dh, dh.getPortals(cat.getId()));
    this.cat = cat;
  }
  
  @Override
  protected void onAdd(Portal p) {
    dh.addPortalToCategory(p.getId(), cat.getId());
  }
  
  @Override
  protected void onRemove(Portal p) {
    dh.deletePortal(p.getId(), cat.getId());
  }
  
  public void changeCategory(Category cat) {
    internalList = dh.getPortals(cat.getId());
    this.cat = cat;
  }
}




Java Source Code List

de.lehrbaum.keycounter.AbstractEncapsuledList.java
de.lehrbaum.keycounter.CategoriesFragment.java
de.lehrbaum.keycounter.Category.java
de.lehrbaum.keycounter.CounterListAdapter.java
de.lehrbaum.keycounter.DatabaseHandler.java
de.lehrbaum.keycounter.MainActivity.java
de.lehrbaum.keycounter.MainFragment.java
de.lehrbaum.keycounter.PortalList.java
de.lehrbaum.keycounter.PortalView.java
de.lehrbaum.keycounter.Portal.java