8

I'm at the starting point of developing an android app similar to a "mindmap" program (like Thinking Space). It shows some graph nodes (containing text, maybe images) and edges that connecting them. I can take care of graph algorithms, but I have two uncertain points about Android components for displaying these things:

  1. The expanded graph will be pretty big, so the user need to be able to scroll both vertically and horizontally. I looked at ScrollView and HorizontalScrollView but they can't scroll both vertically and horizontally. So I hope to know which top level container I should use.

  2. I also want the graph to be zoomable with pinch gestures, so that the user can zoom in to a small part of the graph. But I also want the graph nodes to be interactive, so the user can tap on them, typing text into them and move them with fingers. Should I implement each node as a separate View object? If so, how do I make all the nodes zoom together?

Thanks.

2
  • Does someone know a ready-made solution which maybe became available in the last year? Commented Dec 13, 2012 at 21:23
  • @Ian Can you throw pointers on how you went about it? Commented May 8, 2014 at 15:16

1 Answer 1

3

I would definitely rely on custom views for this kind of things, they will give you much more freedom and efficiency than using standard layouts.

Implementing a scrollable view is quite easy, and implementing the pinch gesture will be much easier if you're supporting API >= 8 (see ScaleGestureDetector). Making graph elements interactive and editable would be another thing, though.

Something really much better could be creating a custom layout, that would host editable graph elements (custom views) and draw their relations. It would be much more elegant, clean, expandable, maintainable and reusable, but it would need a lot more designing. Yet I'm sure it would be greatly rewarded.

(This would be quite an ambitious project for me, so... good luck!)

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.