Android Open Source - android-tutorials-custom-selectable-listview Item






From Project

Back to project page android-tutorials-custom-selectable-listview.

License

The source code is released under:

Apache License

If you think the Android project android-tutorials-custom-selectable-listview 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

/**
 * /* w ww. j av a 2 s .co  m*/
 */
package fr.marvinlabs.selectablelisttutorial.pojo;

/**
 * A POJO that contains some properties to show in the list
 * 
 * @author marvinlabs
 */
public class Item implements Comparable<Item> {

  private long id;
  private String caption;

  public Item(long id, String caption) {
    super();
    this.id = id;
    this.caption = caption;
  }

  public long getId() {
    return id;
  }

  public void setId(long id) {
    this.id = id;
  }

  public String getCaption() {
    return caption;
  }

  public void setCaption(String caption) {
    this.caption = caption;
  }

  /**
   * Comparable interface implementation
   * 
   * @see java.lang.Comparable#compareTo(java.lang.Object)
   */
  public int compareTo(Item other) {
    return (int) (id - other.getId());
  }
}




Java Source Code List

fr.marvinlabs.selectablelisttutorial.ItemListAdapter.java
fr.marvinlabs.selectablelisttutorial.MainActivity.java
fr.marvinlabs.selectablelisttutorial.pojo.Item.java
fr.marvinlabs.widget.CheckableRelativeLayout.java
fr.marvinlabs.widget.InertCheckBox.java