New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can I get item layout from adapter ? #46
Comments
You're using this library in the wrong way. GraphView works similar to how you would use the RecyclerView. Create the adapter with the viewholder pattern. In the viewholder you have your item view, where you get your child views from. If you look in the readme you find an example or look in the sample folder. |
yes, I was do same like you say, my graph is showing,, but I want to custom the node by get item layout from adapter.. Can you show me the simple code to that case ? I was see the sample code but nothing |
What do you mean by "custom the node"? If you just want to change your data, you have to change it in the node object inside the graph. Then just call Setting the data to the views should only be done inside the adapters |
custom node layout,, not data of node. I want to change item layout with different way,, not on onBindView,, |
You can change the item layout in the Create a layout xml for your item and inflate it in this method. For different layouts in one graph you have to implement the getItemViewType and check the view type in Like I said earlier, GraphView can be used just like a RecyclerView. You can google your problem and adapt the solution to GraphView or ask on StackOverflow. |
yes,, that is still in onCreateView method, I want to different way, outside OnCreateView. like this: https://stackoverflow.com/a/54751851 can I do that ? |
No, this is not possible. |
I was try with this script but nothing happen.
View v =adapter.getView(0, null, graphView);
TextView t = v.findViewById(R.id.t1);
t.setText("TEST");
The text was updated successfully, but these errors were encountered: