Skip to content
Open
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions sample/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_marginTop="48dp"
app:orientation="horizontal" />
app:lcp_orientation="horizontal" />

<uz.shift.colorpicker.LineColorPicker
android:id="@+id/picker2"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginTop="50dp"
app:orientation="horizontal" />
app:lcp_orientation="horizontal" />

<uz.shift.colorpicker.LineColorPicker
android:layout_width="match_parent"
android:layout_height="60dip"
android:id="@+id/picker3"
app:selectedColorIndex="3"
app:colors="@array/sample_colors"/>
app:lcp_selectedColorIndex="3"
app:lcp_colors="@array/sample_colors"/>

<!--<uz.shift.colorpicker.LineColorPicker-->
<!--android:id="@+id/picker3"-->
Expand Down
6 changes: 3 additions & 3 deletions sample2/src/main/res/layout/fragment_color_chooser.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
android:id="@+id/picker"
android:layout_width="match_parent"
android:layout_height="60dp"
app:colors="@array/rainbow"
app:selectedColorIndex="3"
app:orientation="horizontal"
app:lcp_colors="@array/rainbow"
app:lcp_selectedColorIndex="3"
app:lcp_orientation="horizontal"
android:layout_alignParentTop="true"
android:layout_marginTop="32dp"
android:layout_alignParentLeft="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,18 @@ public LineColorPicker(Context context, AttributeSet attrs) {
final TypedArray a = context.getTheme().obtainStyledAttributes(attrs, R.styleable.LineColorPicker, 0, 0);

try {
mOrientation = a.getInteger(R.styleable.LineColorPicker_orientation, HORIZONTAL);
mOrientation = a.getInteger(R.styleable.LineColorPicker_lcp_orientation, HORIZONTAL);

if (!isInEditMode()) {
final int colorsArrayResId = a.getResourceId(R.styleable.LineColorPicker_colors, -1);
final int colorsArrayResId = a.getResourceId(R.styleable.LineColorPicker_lcp_colors, -1);

if (colorsArrayResId > 0) {
final int[] colors = context.getResources().getIntArray(colorsArrayResId);
setColors(colors);
}
}

final int selected = a.getInteger(R.styleable.LineColorPicker_selectedColorIndex, -1);
final int selected = a.getInteger(R.styleable.LineColorPicker_lcp_selectedColorIndex, -1);

if (selected != -1) {
final int[] currentColors = getColors();
Expand Down
6 changes: 3 additions & 3 deletions shiftcolorpicker/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<resources>

<declare-styleable name="LineColorPicker">
<attr name="orientation" format="enum">
<attr name="lcp_orientation" format="enum">
<enum name="horizontal" value="0" />
<enum name="vertical" value="1" />
</attr>
<attr name="colors" format="reference" />
<attr name="selectedColorIndex" format="integer" />
<attr name="lcp_colors" format="reference" />
<attr name="lcp_selectedColorIndex" format="integer" />
</declare-styleable>

</resources>