Skip to content

Commit a4140ab

Browse files
committed
added ActionMode attributes
1 parent fec0daa commit a4140ab

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

colorpickerview/src/main/java/com/skydoves/colorpickerview/ColorPickerDialog.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import android.content.DialogInterface;
2323
import android.view.LayoutInflater;
2424
import android.view.View;
25-
2625
import com.skydoves.colorpickerview.flag.FlagView;
2726
import com.skydoves.colorpickerview.listeners.ColorEnvelopeListener;
2827
import com.skydoves.colorpickerview.listeners.ColorListener;

colorpickerview/src/main/java/com/skydoves/colorpickerview/ColorPickerView.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ private void getAttrs(AttributeSet attrs) {
9999
a.getFloat(R.styleable.ColorPickerView_alpha_selector, alpha_selector);
100100
if (a.hasValue(R.styleable.ColorPickerView_alpha_flag))
101101
alpha_flag = a.getFloat(R.styleable.ColorPickerView_alpha_flag, alpha_flag);
102+
if (a.hasValue(R.styleable.ColorPickerView_actionMode)) {
103+
int actionMode = a.getInteger(R.styleable.ColorPickerView_actionMode, 0);
104+
if (actionMode == 0) this.actionMode = ActionMode.ALWAYS;
105+
else if (actionMode == 1) this.actionMode = ActionMode.LAST;
106+
}
102107
} finally {
103108
a.recycle();
104109
}

colorpickerview/src/main/res/values/attrs_colorpicker.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
<attr name="selector" format="reference" />
66
<attr name="alpha_selector" format="float" />
77
<attr name="alpha_flag" format="float" />
8+
<attr name="actionMode" format="enum">
9+
<enum name="always" value="0"/>
10+
<enum name="last" value="1"/>
11+
</attr>
812
</declare-styleable>
913
<declare-styleable name="MultiColorPickerView">
1014
<attr name="palette2" format="reference" />

0 commit comments

Comments
 (0)