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);
}
Aggregations