
package com.battlelancer.seriesguide.enums;

import com.battlelancer.seriesguide.beta.R;

import java.util.HashMap;
import java.util.Map;

public enum WidgetListType {
    UPCOMING(0, R.id.radioUpcoming), RECENT(1, R.id.radioRecent);

    public int index;

    public int id;

    private WidgetListType(int index, int id) {
        this.index = index;
        this.id = id;
    }

    private static final Map<Integer, WidgetListType> MAPPING = new HashMap<Integer, WidgetListType>();

    static {
        for (WidgetListType via : WidgetListType.values()) {
            MAPPING.put(via.id, via);
        }
    }

    public static WidgetListType fromId(int id) {
        return MAPPING.get(id);
    }
}

@@ -39,16 +39,50 @@
 enums;%0A%0A
+import android.util.SparseArray;%0A%0A
 import c
@@ -122,57 +122,8 @@
 R;%0A%0A
-import java.util.HashMap;%0Aimport java.util.Map;%0A%0A
 publ
@@ -387,29 +387,28 @@
 c final 
-Map%3CInteger, 
+SparseArray%3C
 WidgetLi
@@ -433,25 +433,20 @@
 new 
-HashMap%3CInteger, 
+SparseArray%3C
 Widg

Use SparseArray.