Merge pull request #34 from BrianPinsard/master

Fix for undo arrow color
This commit is contained in:
Tibor Kaputa 2017-01-04 19:51:55 +01:00 committed by GitHub
commit 1feeb8ac49
1 changed files with 11 additions and 7 deletions

View File

@ -58,7 +58,7 @@ public class MainActivity extends SimpleActivity implements MyCanvas.PathsChange
ButterKnife.bind(this); ButterKnife.bind(this);
mMyCanvas.setListener(this); mMyCanvas.setListener(this);
mMyCanvas.setBackgroundColor(mConfig.getBackgroundColor()); setBackgroundColor(mConfig.getBackgroundColor());
setColor(mConfig.getBrushColor()); setColor(mConfig.getBrushColor());
} }
@ -105,12 +105,7 @@ public class MainActivity extends SimpleActivity implements MyCanvas.PathsChange
@Override @Override
public void onOk(AmbilWarnaDialog dialog, int pickedColor) { public void onOk(AmbilWarnaDialog dialog, int pickedColor) {
if (Utils.shouldUseWhite(pickedColor)) { setBackgroundColor(pickedColor);
((ImageView) mUndoBtn).setImageResource(R.mipmap.undo_white);
} else {
((ImageView) mUndoBtn).setImageResource(R.mipmap.undo_black);
}
mMyCanvas.setBackgroundColor(pickedColor);
mConfig.setBackgroundColor(pickedColor); mConfig.setBackgroundColor(pickedColor);
} }
}); });
@ -276,6 +271,15 @@ public class MainActivity extends SimpleActivity implements MyCanvas.PathsChange
dialog.show(); dialog.show();
} }
private void setBackgroundColor(int pickedColor) {
if (Utils.shouldUseWhite(pickedColor)) {
((ImageView) mUndoBtn).setImageResource(R.mipmap.undo_white);
} else {
((ImageView) mUndoBtn).setImageResource(R.mipmap.undo_black);
}
mMyCanvas.setBackgroundColor(pickedColor);
}
private void setColor(int pickedColor) { private void setColor(int pickedColor) {
color = pickedColor; color = pickedColor;
mColorPicker.setBackgroundColor(color); mColorPicker.setBackgroundColor(color);