[Android] Add disable state to custom checkbox
Alexandre Perraud
git at videolan.org
Wed May 13 13:29:44 CEST 2015
vlc-ports/android | branch: master | Alexandre Perraud <4leyx4ndre at gmail.com> | Wed May 13 13:28:42 2015 +0200| [e2f5a1e41feb3a5439e1f88587637bf55c146c2b] | committer: Alexandre Perraud
Add disable state to custom checkbox
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=e2f5a1e41feb3a5439e1f88587637bf55c146c2b
---
assets/images/svg/ic_checkbox_false_disable.svg | 72 ++++++++++++++++++++
assets/images/svg/ic_checkbox_true_disable.svg | 72 ++++++++++++++++++++
.../drawable-hdpi/ic_checkbox_false_disable.png | Bin 0 -> 282 bytes
.../res/drawable-hdpi/ic_checkbox_true_disable.png | Bin 0 -> 404 bytes
.../drawable-ldpi/ic_checkbox_false_disable.png | Bin 0 -> 243 bytes
.../res/drawable-ldpi/ic_checkbox_true_disable.png | Bin 0 -> 308 bytes
.../drawable-mdpi/ic_checkbox_false_disable.png | Bin 0 -> 226 bytes
.../res/drawable-mdpi/ic_checkbox_true_disable.png | Bin 0 -> 308 bytes
.../drawable-xhdpi/ic_checkbox_false_disable.png | Bin 0 -> 333 bytes
.../drawable-xhdpi/ic_checkbox_true_disable.png | Bin 0 -> 485 bytes
.../res/drawable/custom_checkbox_button.xml | 12 ++--
11 files changed, 152 insertions(+), 4 deletions(-)
diff --git a/assets/images/svg/ic_checkbox_false_disable.svg b/assets/images/svg/ic_checkbox_false_disable.svg
new file mode 100644
index 0000000..4761503
--- /dev/null
+++ b/assets/images/svg/ic_checkbox_false_disable.svg
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="20"
+ height="20"
+ id="svg4682"
+ version="1.1"
+ inkscape:version="0.91 r13725"
+ sodipodi:docname="ic_checkbox_false_disable.svg"
+ inkscape:export-filename="/home/corbax/Dev/android/Icons/Test 1/ic_play_normal.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90">
+ <defs
+ id="defs4684" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="22.4"
+ inkscape:cx="-1.0098388"
+ inkscape:cy="12.820263"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ inkscape:window-width="1920"
+ inkscape:window-height="1056"
+ inkscape:window-x="1920"
+ inkscape:window-y="24"
+ inkscape:window-maximized="1">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3846"
+ empspacing="4"
+ visible="true"
+ enabled="true"
+ snapvisiblegridlinesonly="true" />
+ </sodipodi:namedview>
+ <metadata
+ id="metadata4687">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1032.3622)">
+ <path
+ style="color:#000000;fill:#ffca7d;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.5;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ d="m 6,1037.3622 c -0.554,0 -1,0.446 -1,1 l 0,8 c 0,0.554 0.446,1 1,1 l 8,0 c 0.554,0 1,-0.446 1,-1 l 0,-8 c 0,-0.554 -0.446,-1 -1,-1 l -8,0 z m 0,1 8,0 0,8 -8,0 0,-8 z"
+ id="rect4929"
+ inkscape:connector-curvature="0" />
+ </g>
+</svg>
diff --git a/assets/images/svg/ic_checkbox_true_disable.svg b/assets/images/svg/ic_checkbox_true_disable.svg
new file mode 100644
index 0000000..6099c60
--- /dev/null
+++ b/assets/images/svg/ic_checkbox_true_disable.svg
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="20"
+ height="20"
+ id="svg4682"
+ version="1.1"
+ inkscape:version="0.91 r13725"
+ sodipodi:docname="ic_checkbox_true_disable.svg"
+ inkscape:export-filename="/home/corbax/Dev/android/Icons/Test 1/ic_play_normal.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90">
+ <defs
+ id="defs4684" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="15.839192"
+ inkscape:cx="-13.039463"
+ inkscape:cy="17.490209"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ inkscape:window-width="1920"
+ inkscape:window-height="1056"
+ inkscape:window-x="1920"
+ inkscape:window-y="24"
+ inkscape:window-maximized="1">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3846"
+ empspacing="4"
+ visible="true"
+ enabled="true"
+ snapvisiblegridlinesonly="true" />
+ </sodipodi:namedview>
+ <metadata
+ id="metadata4687">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1032.3622)">
+ <path
+ style="color:#000000;fill:#ffca7d;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.5;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ d="m 6,1037.3622 c -0.554,0 -1,0.446 -1,1 l 0,8 c 0,0.554 0.446,1 1,1 l 8,0 c 0.554,0 1,-0.446 1,-1 l 0,-8 c 0,-0.554 -0.446,-1 -1,-1 l -8,0 z m 6.28125,2.2813 0.71875,0.7187 -4,4 -2,-2 0.71875,-0.7187 1.28125,1.2812 3.28125,-3.2812 z"
+ id="rect4931"
+ inkscape:connector-curvature="0" />
+ </g>
+</svg>
diff --git a/vlc-android/res/drawable-hdpi/ic_checkbox_false_disable.png b/vlc-android/res/drawable-hdpi/ic_checkbox_false_disable.png
new file mode 100644
index 0000000..43e0259
Binary files /dev/null and b/vlc-android/res/drawable-hdpi/ic_checkbox_false_disable.png differ
diff --git a/vlc-android/res/drawable-hdpi/ic_checkbox_true_disable.png b/vlc-android/res/drawable-hdpi/ic_checkbox_true_disable.png
new file mode 100644
index 0000000..76911e6
Binary files /dev/null and b/vlc-android/res/drawable-hdpi/ic_checkbox_true_disable.png differ
diff --git a/vlc-android/res/drawable-ldpi/ic_checkbox_false_disable.png b/vlc-android/res/drawable-ldpi/ic_checkbox_false_disable.png
new file mode 100644
index 0000000..d9dfe9e
Binary files /dev/null and b/vlc-android/res/drawable-ldpi/ic_checkbox_false_disable.png differ
diff --git a/vlc-android/res/drawable-ldpi/ic_checkbox_true_disable.png b/vlc-android/res/drawable-ldpi/ic_checkbox_true_disable.png
new file mode 100644
index 0000000..24fc8f2
Binary files /dev/null and b/vlc-android/res/drawable-ldpi/ic_checkbox_true_disable.png differ
diff --git a/vlc-android/res/drawable-mdpi/ic_checkbox_false_disable.png b/vlc-android/res/drawable-mdpi/ic_checkbox_false_disable.png
new file mode 100644
index 0000000..47aa433
Binary files /dev/null and b/vlc-android/res/drawable-mdpi/ic_checkbox_false_disable.png differ
diff --git a/vlc-android/res/drawable-mdpi/ic_checkbox_true_disable.png b/vlc-android/res/drawable-mdpi/ic_checkbox_true_disable.png
new file mode 100644
index 0000000..05f2f5b
Binary files /dev/null and b/vlc-android/res/drawable-mdpi/ic_checkbox_true_disable.png differ
diff --git a/vlc-android/res/drawable-xhdpi/ic_checkbox_false_disable.png b/vlc-android/res/drawable-xhdpi/ic_checkbox_false_disable.png
new file mode 100644
index 0000000..1f089de
Binary files /dev/null and b/vlc-android/res/drawable-xhdpi/ic_checkbox_false_disable.png differ
diff --git a/vlc-android/res/drawable-xhdpi/ic_checkbox_true_disable.png b/vlc-android/res/drawable-xhdpi/ic_checkbox_true_disable.png
new file mode 100644
index 0000000..a709406
Binary files /dev/null and b/vlc-android/res/drawable-xhdpi/ic_checkbox_true_disable.png differ
diff --git a/vlc-android/res/drawable/custom_checkbox_button.xml b/vlc-android/res/drawable/custom_checkbox_button.xml
index 091d0a0..f56c7d6 100644
--- a/vlc-android/res/drawable/custom_checkbox_button.xml
+++ b/vlc-android/res/drawable/custom_checkbox_button.xml
@@ -1,8 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:state_checkable="true"
- android:drawable="@drawable/ic_checkbox_false" />
- <item android:state_checked="true"
- android:drawable="@drawable/ic_checkbox_true" />
+ <item android:drawable="@drawable/ic_checkbox_false"
+ android:state_enabled="true" android:state_checked="false" />
+ <item android:drawable="@drawable/ic_checkbox_false_disable"
+ android:state_enabled="false" android:state_checked="false" />
+ <item android:drawable="@drawable/ic_checkbox_true"
+ android:state_enabled="true" android:state_checked="true" />
+ <item android:drawable="@drawable/ic_checkbox_true_disable"
+ android:state_enabled="false" android:state_checked="true" />
<item android:drawable="@drawable/ic_checkbox_false" />
</selector>
\ No newline at end of file
More information about the Android
mailing list