Home | History | Annotate | Download | only in dummy
      1 package ${packageName}.dummy;
      2 
      3 import java.util.ArrayList;
      4 import java.util.HashMap;
      5 import java.util.List;
      6 import java.util.Map;
      7 
      8 /**
      9  * Helper class for providing sample content for user interfaces created by
     10  * Android template wizards.
     11  * <p>
     12  * TODO: Replace all uses of this class before publishing your app.
     13  */
     14 public class DummyContent {
     15 
     16     /**
     17      * An array of sample (dummy) items.
     18      */
     19     public static List<DummyItem> ITEMS = new ArrayList<DummyItem>();
     20 
     21     /**
     22      * A map of sample (dummy) items, by ID.
     23      */
     24     public static Map<String, DummyItem> ITEM_MAP = new HashMap<String, DummyItem>();
     25 
     26     static {
     27         // Add 3 sample items.
     28         addItem(new DummyItem("1", "Item 1"));
     29         addItem(new DummyItem("2", "Item 2"));
     30         addItem(new DummyItem("3", "Item 3"));
     31     }
     32 
     33     private static void addItem(DummyItem item) {
     34         ITEMS.add(item);
     35         ITEM_MAP.put(item.id, item);
     36     }
     37 
     38     /**
     39      * A dummy item representing a piece of content.
     40      */
     41     public static class DummyItem {
     42         public String id;
     43         public String content;
     44 
     45         public DummyItem(String id, String content) {
     46             this.id = id;
     47             this.content = content;
     48         }
     49 
     50         @Override
     51         public String toString() {
     52             return content;
     53         }
     54     }
     55 }
     56