Drawing app android: how to undo path, fill color -


i'm creating drawing app feature undo.my app can draw line, fill color. if app have feature draw line, have solution use array list store path , redraw when use tap undo app support fill color (paint bucket) feature. don't found best solution undo. have ideas??????

for undo , redo

 public void onclickundo () {   if (paths.size()>0) {     undonepaths.add(paths.remove(paths.size()-1))    invalidate();  }  else  //toast user  }  public void onclickredo (){ if (undonepaths.size()>0) {     paths.add(undonepaths.remove(undonepaths.size()-1))     invalidate(); }  else   //toast user  } 

Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -