Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public class ColorPickerView extends View {
* Trackers can extend outside slightly,
* due to the required padding we have set.
*/
private Rect drawingRect;
private Rect drawingRect=new Rect();

private Rect satValRect;
private Rect hueRect;
Expand Down Expand Up @@ -729,7 +729,7 @@ private int getPreferredHeight() {
return Math.max(super.getPaddingRight(), mRequiredPadding);
}

@Override protected void onSizeChanged(int w, int h, int oldw, int oldh) {
/*@Override protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);

drawingRect = new Rect();
Expand All @@ -747,6 +747,33 @@ private int getPreferredHeight() {
satValBackgroundCache = null;
hueBackgroundCache = null;

setUpSatValRect();
setUpHueRect();
setUpAlphaRect();
}*/

@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
super.onLayout(changed, left, top, right, bottom);

int w=getWidth();
int h=getHeight();

// drawingRect = new Rect();
drawingRect.left = getPaddingLeft();
drawingRect.right = w - getPaddingRight();
drawingRect.top = getPaddingTop();
drawingRect.bottom = h - getPaddingBottom();

//The need to be recreated because they depend on the size of the view.
valShader = null;
satShader = null;
alphaShader = null;

// Clear those bitmap caches since the size may have changed.
satValBackgroundCache = null;
hueBackgroundCache = null;

setUpSatValRect();
setUpHueRect();
setUpAlphaRect();
Expand Down Expand Up @@ -878,6 +905,10 @@ public void setAlphaSliderVisible(boolean visible) {
}
}

public boolean getAlphaSliderVisible(){
return showAlphaPanel;
}

/**
* Get color of the tracker slider on the hue and alpha panel.
*
Expand Down