public class BarGraphFragment extends ItemDetailFragment {
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View rootView = inflater.inflate(R.layout.bar_graph_content, container, false);

        GraphView graph = (GraphView) rootView.findViewById(R.id.graph);
        new SimpleBarGraph().initGraph(graph);
        rootView.findViewById(R.id.cardSimpleBarGraph).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openFullscreen(FullscreenExample.SIMPLE_BAR_GRAPH);
            }
        });
        rootView.findViewById(R.id.imgFullscreen).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openFullscreen(FullscreenExample.SIMPLE_BAR_GRAPH);
            }
        });
        rootView.findViewById(R.id.imgSource).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openSource(FullscreenExample.SIMPLE_BAR_GRAPH);
            }
        });

        graph = (GraphView) rootView.findViewById(R.id.graph2);
        new AdvancedBarGraph().initGraph(graph);
        rootView.findViewById(R.id.cardAdvancedBarGraph).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openFullscreen(FullscreenExample.ADVANCED_BAR_GRAPH);
            }
        });
        rootView.findViewById(R.id.imgFullscreen2).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openFullscreen(FullscreenExample.ADVANCED_LINE_GRAPH);
            }
        });
        rootView.findViewById(R.id.imgSource2).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openSource(FullscreenExample.ADVANCED_LINE_GRAPH);
            }
        });

        graph = (GraphView) rootView.findViewById(R.id.graph3);
        new MultipleBarGraph().initGraph(graph);
        rootView.findViewById(R.id.cardMultipleBarGraph).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openFullscreen(FullscreenExample.MULTIPLE_BAR_GRAPH);
            }
        });
        rootView.findViewById(R.id.imgFullscreen3).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openFullscreen(FullscreenExample.MULTIPLE_BAR_GRAPH);
            }
        });
        rootView.findViewById(R.id.imgSource3).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openSource(FullscreenExample.MULTIPLE_BAR_GRAPH);
            }
        });

        return rootView;
    }
} public class HelloWorldFragment extends ItemDetailFragment {
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View rootView = inflater.inflate(R.layout.hello_world_content, container, false);

        GraphView graph = (GraphView) rootView.findViewById(R.id.graph);
        new HelloWorld().initGraph(graph);

        rootView.findViewById(R.id.cardHelloWorldGraph).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openFullscreen(FullscreenExample.HELLO_WORLD);
            }
        });
        rootView.findViewById(R.id.imgFullscreen).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openFullscreen(FullscreenExample.HELLO_WORLD);
            }
        });
        rootView.findViewById(R.id.imgSource).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openSource(FullscreenExample.HELLO_WORLD);
            }
        });

        return rootView;
    }
} public class OthersFragment extends ItemDetailFragment {
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View rootView = inflater.inflate(R.layout.others_content, container, false);

        rootView.findViewById(R.id.cardSnapshotGraph).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openFullscreen(FullscreenExample.SNAPSHOT_SHARE);
            }
        });
        rootView.findViewById(R.id.imgFullscreen1).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openFullscreen(FullscreenExample.SNAPSHOT_SHARE);
            }
        });
        rootView.findViewById(R.id.imgSource1).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openSource(FullscreenExample.SNAPSHOT_SHARE);
            }
        });

        return rootView;
    }
} public class PointsGraphFragment extends ItemDetailFragment {
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View rootView = inflater.inflate(R.layout.points_graph_content, container, false);

        GraphView graph = (GraphView) rootView.findViewById(R.id.graph);
        new SimplePointsGraph().initGraph(graph);
        rootView.findViewById(R.id.cardSimplePointsGraph).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openFullscreen(FullscreenExample.SIMPLE_POINTS_GRAPH);
            }
        });
        rootView.findViewById(R.id.imgFullscreen).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openFullscreen(FullscreenExample.SIMPLE_POINTS_GRAPH);
            }
        });
        rootView.findViewById(R.id.imgSource).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openSource(FullscreenExample.SIMPLE_POINTS_GRAPH);
            }
        });

        return rootView;
    }
} public class RealtimeFragment extends ItemDetailFragment {
    private BaseExample mLogicFixedFrame;
    private BaseExample mLogicRealtimeScrolling;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mLogicFixedFrame = new FixedFrame();
        mLogicRealtimeScrolling = new RealtimeScrolling();
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View rootView = inflater.inflate(R.layout.realtime_content, container, false);

        GraphView graph = (GraphView) rootView.findViewById(R.id.graph);
        mLogicFixedFrame.initGraph(graph);
        rootView.findViewById(R.id.cardFixedFrame).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openFullscreen(FullscreenExample.FIXED_FRAME);
            }
        });
        rootView.findViewById(R.id.imgFullscreen).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openFullscreen(FullscreenExample.FIXED_FRAME);
            }
        });
        rootView.findViewById(R.id.imgSource).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openSource(FullscreenExample.FIXED_FRAME);
            }
        });

        graph = (GraphView) rootView.findViewById(R.id.graph2);
        mLogicRealtimeScrolling.initGraph(graph);
        rootView.findViewById(R.id.cardScrolling).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openFullscreen(FullscreenExample.REALTIME_SCROLLING);
            }
        });
        rootView.findViewById(R.id.imgFullscreen2).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openFullscreen(FullscreenExample.REALTIME_SCROLLING);
            }
        });
        rootView.findViewById(R.id.imgSource2).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openSource(FullscreenExample.REALTIME_SCROLLING);
            }
        });

        rootView.findViewById(R.id.cardAddSeriesAtRuntime).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openFullscreen(FullscreenExample.ADD_SERIES);
            }
        });
        rootView.findViewById(R.id.imgFullscreen3).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openFullscreen(FullscreenExample.ADD_SERIES);
            }
        });
        rootView.findViewById(R.id.imgSource3).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openSource(FullscreenExample.ADD_SERIES);
            }
        });

        return rootView;
    }

    @Override
    public void onResume() {
        super.onResume();
        mLogicFixedFrame.onResume();
        mLogicRealtimeScrolling.onResume();
    }

    @Override
    public void onPause() {
        mLogicFixedFrame.onPause();
        mLogicRealtimeScrolling.onPause();
        super.onPause();
    }
} public class LineGraphFragment extends ItemDetailFragment {
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View rootView = inflater.inflate(R.layout.line_graph_content, container, false);

        GraphView graph = (GraphView) rootView.findViewById(R.id.graph);
        new SimpleLineGraph().initGraph(graph);
        rootView.findViewById(R.id.cardSimpleLineGraph).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openFullscreen(FullscreenExample.SIMPLE_LINE_GRAPH);
            }
        });
        rootView.findViewById(R.id.imgFullscreen).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openFullscreen(FullscreenExample.SIMPLE_LINE_GRAPH);
            }
        });
        rootView.findViewById(R.id.imgSource).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openSource(FullscreenExample.SIMPLE_LINE_GRAPH);
            }
        });

        graph = (GraphView) rootView.findViewById(R.id.graph2);
        new AdvancedLineGraph().initGraph(graph);
        rootView.findViewById(R.id.cardAdvancedLineGraph).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openFullscreen(FullscreenExample.ADVANCED_LINE_GRAPH);
            }
        });
        rootView.findViewById(R.id.imgFullscreen2).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openFullscreen(FullscreenExample.ADVANCED_LINE_GRAPH);
            }
        });
        rootView.findViewById(R.id.imgSource2).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openSource(FullscreenExample.ADVANCED_LINE_GRAPH);
            }
        });

        graph = (GraphView) rootView.findViewById(R.id.graph4);
        new UniqueLegendLineGraph().initGraph(graph);
        rootView.findViewById(R.id.cardUniqueLegendLineGraph).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openFullscreen(FullscreenExample.UNIQUE_LEGEND_LINE_GRAPH);
            }
        });
        rootView.findViewById(R.id.imgFullscreen4).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openFullscreen(FullscreenExample.UNIQUE_LEGEND_LINE_GRAPH);
            }
        });
        rootView.findViewById(R.id.imgSource4).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openSource(FullscreenExample.UNIQUE_LEGEND_LINE_GRAPH);
            }
        });

        return rootView;
    }
} public class SecondScaleAndLabelsFragment extends ItemDetailFragment {
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View rootView = inflater.inflate(R.layout.second_scale_and_labels_content, container, false);

        GraphView graph = (GraphView) rootView.findViewById(R.id.graph);
        new SecondScaleGraph().initGraph(graph);
        rootView.findViewById(R.id.cardSecondScaleGraph).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openFullscreen(FullscreenExample.SECOND_SCALE_GRAPH);
            }
        });
        rootView.findViewById(R.id.imgFullscreen).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openFullscreen(FullscreenExample.SECOND_SCALE_GRAPH);
            }
        });
        rootView.findViewById(R.id.imgSource).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openSource(FullscreenExample.SECOND_SCALE_GRAPH);
            }
        });

        graph = (GraphView) rootView.findViewById(R.id.graph2);
        new CustomLabelsGraph().initGraph(graph);
        rootView.findViewById(R.id.cardCustomLabelsGraph).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openFullscreen(FullscreenExample.CUSTOM_LABELS);
            }
        });
        rootView.findViewById(R.id.imgFullscreen2).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openFullscreen(FullscreenExample.CUSTOM_LABELS);
            }
        });
        rootView.findViewById(R.id.imgSource2).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openSource(FullscreenExample.CUSTOM_LABELS);
            }
        });

        graph = (GraphView) rootView.findViewById(R.id.graph3);
        new NoLabelsGraph().initGraph(graph);
        rootView.findViewById(R.id.cardNoLabelsGraph).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openFullscreen(FullscreenExample.NO_LABELS);
            }
        });
        rootView.findViewById(R.id.imgFullscreen3).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openFullscreen(FullscreenExample.NO_LABELS);
            }
        });
        rootView.findViewById(R.id.imgSource3).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openSource(FullscreenExample.NO_LABELS);
            }
        });

        graph = (GraphView) rootView.findViewById(R.id.graph4);
        new StaticLabelsGraph().initGraph(graph);
        rootView.findViewById(R.id.cardStaticLabelsGraph).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openFullscreen(FullscreenExample.STATIC_LABELS);
            }
        });
        rootView.findViewById(R.id.imgFullscreen4).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openFullscreen(FullscreenExample.STATIC_LABELS);
            }
        });
        rootView.findViewById(R.id.imgSource4).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openSource(FullscreenExample.STATIC_LABELS);
            }
        });

        return rootView;
    }
} public class StylingExamplesFragment extends ItemDetailFragment {
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View rootView = inflater.inflate(R.layout.styling_examples_content, container, false);

        GraphView graph = (GraphView) rootView.findViewById(R.id.graph);
        new StylingLabels().initGraph(graph);
        rootView.findViewById(R.id.cardStylingLabelsGraph).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openFullscreen(FullscreenExample.STYLING_LABELS);
            }
        });
        rootView.findViewById(R.id.imgFullscreen).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openFullscreen(FullscreenExample.STYLING_LABELS);
            }
        });
        rootView.findViewById(R.id.imgSource).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openSource(FullscreenExample.STYLING_LABELS);
            }
        });

        graph = (GraphView) rootView.findViewById(R.id.graph2);
        new StylingColors().initGraph(graph);
        rootView.findViewById(R.id.cardStylingColorsGraph).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openFullscreen(FullscreenExample.STYLING_COLORS);
            }
        });
        rootView.findViewById(R.id.imgFullscreen2).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openFullscreen(FullscreenExample.STYLING_COLORS);
            }
        });
        rootView.findViewById(R.id.imgSource2).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openSource(FullscreenExample.STYLING_COLORS);
            }
        });

        graph = (GraphView) rootView.findViewById(R.id.graph3);
        new TitlesExample().initGraph(graph);
        rootView.findViewById(R.id.cardTitlesGraph).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openFullscreen(FullscreenExample.TITLES_EXAMPLE);
            }
        });
        rootView.findViewById(R.id.imgFullscreen3).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openFullscreen(FullscreenExample.TITLES_EXAMPLE);
            }
        });
        rootView.findViewById(R.id.imgSource3).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openSource(FullscreenExample.TITLES_EXAMPLE);
            }
        });

        return rootView;
    }
} public class TapListenerGraphFragment extends ItemDetailFragment {
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View rootView = inflater.inflate(R.layout.tap_listener_graph_content, container, false);

        GraphView graph = (GraphView) rootView.findViewById(R.id.graph);
        new TapListenerGraph().initGraph(graph);
        rootView.findViewById(R.id.cardTapListenerGraph).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openFullscreen(FullscreenExample.TAP_LISTENER);
            }
        });
        rootView.findViewById(R.id.imgFullscreen).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openFullscreen(FullscreenExample.TAP_LISTENER);
            }
        });
        rootView.findViewById(R.id.imgSource).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openSource(FullscreenExample.TAP_LISTENER);
            }
        });

        return rootView;
    }
} public class TimeAndDatesFragment extends ItemDetailFragment {
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View rootView = inflater.inflate(R.layout.time_and_dates_content, container, false);

        GraphView graph = (GraphView) rootView.findViewById(R.id.graph);
        new Dates(2).initGraph(graph);

        rootView.findViewById(R.id.cardDatesGraph).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openFullscreen(FullscreenExample.DATES);
            }
        });
        rootView.findViewById(R.id.imgFullscreen).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openFullscreen(FullscreenExample.DATES);
            }
        });
        rootView.findViewById(R.id.imgSource).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openSource(FullscreenExample.DATES);
            }
        });

        return rootView;
    }
} public class ZoomingAndScrollingFragment extends ItemDetailFragment {
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View rootView = inflater.inflate(R.layout.zooming_and_scrolling_content, container, false);

        //GraphView graph = (GraphView) rootView.findViewById(R.id.graph);
        //new HelloWorld().initGraph(graph);

        rootView.findViewById(R.id.cardZoomXYGraph).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openFullscreen(FullscreenExample.SCALING_XY);
            }
        });
        rootView.findViewById(R.id.imgFullscreen).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openFullscreen(FullscreenExample.SCALING_XY);
            }
        });
        rootView.findViewById(R.id.imgSource).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openSource(FullscreenExample.SCALING_XY);
            }
        });

        rootView.findViewById(R.id.cardZoomXGraph).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openFullscreen(FullscreenExample.SCALING_X);
            }
        });
        rootView.findViewById(R.id.imgFullscreen2).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openFullscreen(FullscreenExample.SCALING_X);
            }
        });
        rootView.findViewById(R.id.imgSource2).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openSource(FullscreenExample.SCALING_X);
            }
        });

        rootView.findViewById(R.id.cardScrollXGraph).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openFullscreen(FullscreenExample.SCROLLING_X);
            }
        });
        rootView.findViewById(R.id.imgFullscreen3).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openFullscreen(FullscreenExample.SCROLLING_X);
            }
        });
        rootView.findViewById(R.id.imgSource3).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openSource(FullscreenExample.SCROLLING_X);
            }
        });

        return rootView;
    }
}
import android.support.annotation.DrawableRes;
import android.support.v4.app.Fragment;
import com.jjoe64.graphview_demos.categories.BarGraphFragment;
import com.jjoe64.graphview_demos.categories.HelloWorldFragment;
import com.jjoe64.graphview_demos.categories.OthersFragment;
import com.jjoe64.graphview_demos.categories.PointsGraphFragment;
import com.jjoe64.graphview_demos.categories.RealtimeFragment;
import com.jjoe64.graphview_demos.categories.LineGraphFragment;
import com.jjoe64.graphview_demos.categories.SecondScaleAndLabelsFragment;
import com.jjoe64.graphview_demos.categories.StylingExamplesFragment;
import com.jjoe64.graphview_demos.categories.TapListenerGraphFragment;
import com.jjoe64.graphview_demos.categories.TimeAndDatesFragment;
import com.jjoe64.graphview_demos.categories.ZoomingAndScrollingFragment;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
package com.jjoe64.graphview_demos;




/**
 * Helper class for providing sample content for user interfaces created by
 * Android template wizards.
 */
public class MenuContent {

    /**
     * An array of sample (dummy) items.
     */
    public static final List<MenuItem> ITEMS = new ArrayList<MenuItem>();

    /**
     * A map of sample (dummy) items, by ID.
     */
    public static final Map<String, MenuItem> ITEM_MAP = new HashMap<String, MenuItem>();

    static {
        addItem(new MenuItem("1", "Hello world graph", HelloWorldFragment.class));