change undo arrow color on startup

This commit is contained in:
Brian Pinsard 2017-01-04 18:39:34 +01:00
parent d181d8933e
commit f1db0027e8

View File

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