Merge pull request #34 from BrianPinsard/master
Fix for undo arrow color
This commit is contained in:
commit
1feeb8ac49
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue