Search in sources :

Example 1 with GraphAdapter

use of org.netxms.ui.android.main.adapters.GraphAdapter in project netxms by netxms.

the class GraphBrowser method onCreateStep2.

/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * org.netxms.ui.android.main.activities.AbstractClientActivity#onCreateStep2
	 * (android.os.Bundle)
	 */
@Override
protected void onCreateStep2(Bundle savedInstanceState) {
    dialog = new ProgressDialog(this);
    setContentView(R.layout.graph_view);
    TextView title = (TextView) findViewById(R.id.ScreenTitlePrimary);
    title.setText(R.string.predefined_graphs_title);
    // keeps current list of graphs as datasource for listview
    adapter = new GraphAdapter(this, new ArrayList<String>(), new ArrayList<ArrayList<GraphSettings>>());
    listView = (ExpandableListView) findViewById(R.id.GraphList);
    listView.setOnChildClickListener(new ExpandableListView.OnChildClickListener() {

        @Override
        public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) {
            GraphSettings gs = (GraphSettings) adapter.getChild(groupPosition, childPosition);
            if (gs != null) {
                drawGraph(gs);
                return true;
            }
            return false;
        }
    });
    listView.setAdapter(adapter);
    registerForContextMenu(listView);
}
Also used : GraphAdapter(org.netxms.ui.android.main.adapters.GraphAdapter) GraphSettings(org.netxms.client.datacollection.GraphSettings) ArrayList(java.util.ArrayList) TextView(android.widget.TextView) ProgressDialog(android.app.ProgressDialog) TextView(android.widget.TextView) View(android.view.View) ExpandableListView(android.widget.ExpandableListView) ExpandableListView(android.widget.ExpandableListView)

Aggregations

ProgressDialog (android.app.ProgressDialog)1 View (android.view.View)1 ExpandableListView (android.widget.ExpandableListView)1 TextView (android.widget.TextView)1 ArrayList (java.util.ArrayList)1 GraphSettings (org.netxms.client.datacollection.GraphSettings)1 GraphAdapter (org.netxms.ui.android.main.adapters.GraphAdapter)1