2 * Copyright © 2019 Damyan Ivanov.
3 * This file is part of MoLe.
4 * MoLe is free software: you can distribute it and/or modify it
5 * under the term of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your opinion), any later version.
9 * MoLe is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License terms for details.
14 * You should have received a copy of the GNU General Public License
15 * along with MoLe. If not, see <https://www.gnu.org/licenses/>.
18 package net.ktnx.mobileledger.ui.profiles.dummy;
20 import java.util.ArrayList;
21 import java.util.HashMap;
22 import java.util.List;
26 * Helper class for providing sample content for user interfaces created by
27 * Android template wizards.
29 * TODO: Replace all uses of this class before publishing your app.
31 public class DummyContent {
34 * An array of sample (dummy) items.
36 public static final List<DummyItem> ITEMS = new ArrayList<DummyItem>();
39 * A map of sample (dummy) items, by ID.
41 public static final Map<String, DummyItem> ITEM_MAP = new HashMap<String, DummyItem>();
43 private static final int COUNT = 25;
46 // Add some sample items.
47 for (int i = 1; i <= COUNT; i++) {
48 addItem(createDummyItem(i));
52 private static void addItem(DummyItem item) {
54 ITEM_MAP.put(item.id, item);
57 private static DummyItem createDummyItem(int position) {
58 return new DummyItem(String.valueOf(position), "Item " + position, makeDetails(position));
61 private static String makeDetails(int position) {
62 StringBuilder builder = new StringBuilder();
63 builder.append("Details about Item: ").append(position);
64 for (int i = 0; i < position; i++) {
65 builder.append("\nMore details information here.");
67 return builder.toString();
71 * A dummy item representing a piece of content.
73 public static class DummyItem {
74 public final String id;
75 public final String content;
76 public final String details;
78 public DummyItem(String id, String content, String details) {
80 this.content = content;
81 this.details = details;
85 public String toString() {