Skip to content

Main reference for the private project, 'CONNECT' in my startup team with the new type of SNS diary designed to manage the connections with other people and the places to meet. We tried to make it easier for people to connect with others in this world with the generated big data.

License

Notifications You must be signed in to change notification settings

zero0kkh/2020Nov-android-network-graph

 
 

Repository files navigation

android-network-graph

Description

Network graph based on :

Download

Here's a screenshot :

screen

## Usage

repositories {
    jcenter()
}
dependencies {
    compile 'org.giwi:android-network-graph:0.0.1'
}
  <giwi.org.networkgraph.GraphSurfaceView
      android:id="@+id/mysurface"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:layout_centerHorizontal="true"
      android:layout_centerVertical="true"
      app:nodeBgColor="@android:color/white"
      app:defaultColor="@android:color/black"
      app:edgeColor="@android:color/holo_blue_light"
      app:nodeColor="@android:color/holo_blue_light"
      android:layout_margin="10dp"/>
Node v1 = new SimpleNode("18");
Node v2 = new SimpleNode("24");
graph.getVertex().add(new Vertex(v1, ContextCompat.getDrawable(this, R.drawable.avatar)));
graph.getVertex().add(new Vertex(v2, ContextCompat.getDrawable(this, R.drawable.avatar)));
graph.addEdge(new SimpleEdge(v1, v2, "12"));

Node v3 = new SimpleNode("7");
graph.getVertex().add(new Vertex(v3, ContextCompat.getDrawable(this, R.drawable.avatar)));
graph.addEdge(new SimpleEdge(v2, v3, "23"));

v1 = new SimpleNode("14");
graph.getVertex().add(new Vertex(v1, ContextCompat.getDrawable(this, R.drawable.avatar)));
graph.addEdge(new SimpleEdge(v3, v1, "34"));

v1 = new SimpleNode("10");
graph.getVertex().add(new Vertex(v1, ContextCompat.getDrawable(this, R.drawable.avatar)));
graph.addEdge(new SimpleEdge(v3, v1, "35"));

v1 = new SimpleNode("11");
graph.getVertex().add(new Vertex(v1, ContextCompat.getDrawable(this, R.drawable.avatar)));
graph.addEdge(new SimpleEdge(v1, v3, "36"));
graph.addEdge(new SimpleEdge(v3, v1, "6"));

GraphSurfaceView surface = (GraphSurfaceView) findViewById(R.id.mysurface);
surface.init(graph);

Setting colors programmatically

graph.setDefaultColor(ContextCompat.getColor(this, android.R.color.black));
graph.setEdgeColor(ContextCompat.getColor(this, android.R.color.holo_blue_light));
graph.setNodeColor(ContextCompat.getColor(this, android.R.color.holo_blue_light));
graph.setNodeBgColor(ContextCompat.getColor(this, android.R.color.white));

About

Main reference for the private project, 'CONNECT' in my startup team with the new type of SNS diary designed to manage the connections with other people and the places to meet. We tried to make it easier for people to connect with others in this world with the generated big data.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%