-1

I'm developing a flowchart drawing app for Android. I implemented the shapes, toolbars etc, now users can drag and drop a shape to the drawing surface and the gets drawn using Canvas. I even added a seekbar to let the user decide how big or small shapes will be.

But...

Since this is a flowchart app, users should be able to delete previously placed shapes, undo, redo... etc. I don't know how to implement this feature.

On top of that, users may want to draw a very long and complex flowchart diagram. In that case, I'd have to expand the surface (custom layout?) and let the user zoom in and out by pinching. I don't know how to implement that either.

Are there any libraries/frameworks that'd be helpful? Or can I implement these features without any extra libraries? Please push me in the right direction.

  • Each of these are separate questions, and each of them are too broad. Come back with individual, researched questions. And don't ask for library suggestions, that's always off topic. – Gabe Sechan Mar 12 '18 at 23:08
  • Shall I create two new seperate posts for these two main questions? I thought people would be able to help more this way. – GorkemSahin Mar 12 '18 at 23:12

1 Answers1

0

undo, redo...

If you have developed, or if you have any idea, about "saving" the data created within your application, then it will be easier for you. Store the data of the user's last few shapes(you decide how many) in temporary backup files or in memory(using structures recommended), and in order in which they were added. The data related with flowchart shapes are few (nodes,size,shape-type,content,color) and that makes it even viable.

Next, when the undo or redo is required, pass the data to the drawing processes, which otherwise will be using the user's input normally. I am explaining via simple c++ here:

struct shape {
   int* node[];     //my sample structure for a shape
   string data;
};
struct shape shape1 = { myNode, "AbraKaDabra"}; //my sample data for a shape

//we can store a whole list of instances of the struct shape, LISTS especially, //since they suit the linking-of-shapes purpose completely //Now data from the structs can be passed to drawing functions.

The implementation part depends on you.

Subham Burnwal
  • 310
  • 2
  • 17