Advertisement
Guest User

DummyContent.java

a guest
Mar 9th, 2015
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.57 KB | None | 0 0
  1. package com.example.matthew.masterflow.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", "Bucky", "https://www.thenewboston.com/profile.php?user=2"));
  29.         addItem(new DummyItem("2", "Forum", "https://www.thenewboston.com/forum/"));
  30.         addItem(new DummyItem("3", "Videos", "https://www.thenewbostom.com/videos.php"));
  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 item_name;
  44.         public String url;
  45.  
  46.         public DummyItem(String id, String item_name, String url) {
  47.             this.id = id;
  48.             this.item_name = item_name;
  49.             this.url = url;
  50.         }
  51.  
  52.         @Override
  53.         public String toString() {
  54.             return item_name;
  55.         }
  56.     }
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement