Android Open Source - AndroidGraph Fragment List






From Project

Back to project page AndroidGraph.

License

The source code is released under:

MIT License

If you think the Android project AndroidGraph listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.nimble.android_graph.Activities;
/*w  w w. j  av a 2 s. com*/
import android.content.Context;
import android.os.Bundle;

import java.util.ArrayList;

import com.nimble.androidgraph.R;

/**
 * Created by Michael Leith on 25/07/2014.
 */
public class FragmentList extends ArrayList<GroupsFragment>
{
    int next = 0, current = 0;

    static final int graphLocation = 0;

    GraphFragment graphFragment;
    boolean graphSetup = false;

    public FragmentList(Context context)
    {
        super();
        graphFragment = new GraphFragment(context);

        this.add( generateWithLayout(R.layout.graph_frag) );
    }

    final private GroupsFragment generateWithLayout(int layout)
    {
        GroupsFragment frag = new GroupsFragment();
        Bundle bundle = new Bundle(1);
        bundle.putInt("layout", layout);
        frag.setArguments(bundle);
        return frag;
    }

    public GroupsFragment next() {

        if(this.size() <= next)
            next = 0;
        current = next;
        return this.get( next++ );
    }

    public GroupsFragment getCurrent()
    {
        return this.get( current );
    }

    public GroupsFragment previous() {
        next = current;
        if( --current < 0) {
            current = this.size() - 1;
            next = 0;
        }
        return this.get( current );
    }
    
    public void run() {

        switch(current)
        {
            case(graphLocation):
                loadGraphFrag();
                break;
        }
    }

    private void loadGraphFrag()
    {
        /**
        if(!graphSetup) {
            LinearLayout voltage = this.get(current).getLinearLayout(R.id.VoltageGraph);
            LinearLayout c = this.get(current).getLinearLayout(R.id.CurrentGraph);
            //graphFragment.setLayouts(voltage, c);
            graphSetup = true;
        }
        graphFragment.start();
         */
    }

    public void onStop()
    {
        graphFragment.onPause();
    }
}




Java Source Code List

Nimble.com.androidgraph.ApplicationTest.java
com.nimble.android_graph.Activities.FragmentList.java
com.nimble.android_graph.Activities.GraphActivity.java
com.nimble.android_graph.Activities.GraphFragment.java
com.nimble.android_graph.Activities.GroupsFragment.java
com.nimble.android_graph.Graph.CurveGraph.java
com.nimble.android_graph.Graph.LineGraph.java
com.nimble.android_graph.Graph.Line.java
com.nimble.android_graph.Graph.ScatterGraph.java
com.nimble.android_graph.Graph.SineWave.java
com.nimble.android_graph.Graph_Base.Coord2d.java
com.nimble.android_graph.Graph_Base.GraphDataSettings.java
com.nimble.android_graph.Graph_Base.GraphDrawBackground.java
com.nimble.android_graph.Graph_Base.GraphRelateToScreen.java
com.nimble.android_graph.Graph_Base.GraphThreading.java
com.nimble.android_graph.Graph_Base.GraphTouchEvent.java
com.nimble.android_graph.Graph_Base.GraphViewDimensions.java
com.nimble.android_graph.Graph_Base.GraphView.java
com.nimble.android_graph.Graph_Base.Point.java
com.nimble.android_graph.Graph_Base.Range2d.java
com.nimble.android_graph.Graph.sine_scatter.java
com.nimble.android_graph.generics.Methods.java
com.nimble.android_graph.generics.ViewManipulators.java
com.nimble.android_graph.generics.testingSuite.java