aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--art/md_switch_thumb_disable.svg156
-rw-r--r--art/md_switch_thumb_off_normal.svg153
-rw-r--r--art/md_switch_thumb_off_pressed.svg159
-rw-r--r--art/md_switch_thumb_on_normal.svg146
-rw-r--r--art/md_switch_thumb_on_pressed.svg162
-rwxr-xr-xart/render.rb7
-rw-r--r--build.gradle1
-rw-r--r--src/main/java/eu/siacs/conversations/ui/adapter/AccountAdapter.java6
-rw-r--r--src/main/java/eu/siacs/conversations/ui/widget/Switch.java70
-rw-r--r--src/main/res/drawable-hdpi/switch_thumb_disable.pngbin0 -> 1926 bytes
-rw-r--r--src/main/res/drawable-hdpi/switch_thumb_off_normal.pngbin0 -> 1949 bytes
-rw-r--r--src/main/res/drawable-hdpi/switch_thumb_off_pressed.pngbin0 -> 3478 bytes
-rw-r--r--src/main/res/drawable-hdpi/switch_thumb_on_normal.pngbin0 -> 1920 bytes
-rw-r--r--src/main/res/drawable-hdpi/switch_thumb_on_pressed.pngbin0 -> 3571 bytes
-rw-r--r--src/main/res/drawable-mdpi/switch_thumb_disable.pngbin0 -> 1239 bytes
-rw-r--r--src/main/res/drawable-mdpi/switch_thumb_off_normal.pngbin0 -> 1267 bytes
-rw-r--r--src/main/res/drawable-mdpi/switch_thumb_off_pressed.pngbin0 -> 2233 bytes
-rw-r--r--src/main/res/drawable-mdpi/switch_thumb_on_normal.pngbin0 -> 1256 bytes
-rw-r--r--src/main/res/drawable-mdpi/switch_thumb_on_pressed.pngbin0 -> 2286 bytes
-rw-r--r--src/main/res/drawable-xhdpi/switch_thumb_disable.pngbin0 -> 2762 bytes
-rw-r--r--src/main/res/drawable-xhdpi/switch_thumb_off_normal.pngbin0 -> 2817 bytes
-rw-r--r--src/main/res/drawable-xhdpi/switch_thumb_off_pressed.pngbin0 -> 5050 bytes
-rw-r--r--src/main/res/drawable-xhdpi/switch_thumb_on_normal.pngbin0 -> 2789 bytes
-rw-r--r--src/main/res/drawable-xhdpi/switch_thumb_on_pressed.pngbin0 -> 5328 bytes
-rw-r--r--src/main/res/drawable-xxhdpi/switch_thumb_disable.pngbin0 -> 4539 bytes
-rw-r--r--src/main/res/drawable-xxhdpi/switch_thumb_off_normal.pngbin0 -> 4602 bytes
-rw-r--r--src/main/res/drawable-xxhdpi/switch_thumb_off_pressed.pngbin0 -> 8315 bytes
-rw-r--r--src/main/res/drawable-xxhdpi/switch_thumb_on_normal.pngbin0 -> 4557 bytes
-rw-r--r--src/main/res/drawable-xxhdpi/switch_thumb_on_pressed.pngbin0 -> 8899 bytes
-rw-r--r--src/main/res/drawable-xxxhdpi/switch_thumb_disable.pngbin0 -> 6854 bytes
-rw-r--r--src/main/res/drawable-xxxhdpi/switch_thumb_off_normal.pngbin0 -> 7000 bytes
-rw-r--r--src/main/res/drawable-xxxhdpi/switch_thumb_off_pressed.pngbin0 -> 11984 bytes
-rw-r--r--src/main/res/drawable-xxxhdpi/switch_thumb_on_normal.pngbin0 -> 7037 bytes
-rw-r--r--src/main/res/drawable-xxxhdpi/switch_thumb_on_pressed.pngbin0 -> 12753 bytes
-rw-r--r--src/main/res/drawable/switch_back_off.xml15
-rw-r--r--src/main/res/drawable/switch_back_on.xml16
-rw-r--r--src/main/res/drawable/switch_thumb.xml12
-rw-r--r--src/main/res/layout/account_row.xml5
-rw-r--r--src/main/res/values/styles.xml14
39 files changed, 914 insertions, 8 deletions
diff --git a/art/md_switch_thumb_disable.svg b/art/md_switch_thumb_disable.svg
new file mode 100644
index 00000000..efd83c2d
--- /dev/null
+++ b/art/md_switch_thumb_disable.svg
@@ -0,0 +1,156 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
+ 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:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ sodipodi:docname="md_switch_thumb_disable_centered_square.svg"
+ viewBox="0 0 120 120"
+ height="120"
+ width="120"
+ inkscape:version="0.91 r13725"
+ version="1.1"
+ id="svg2">
+ <metadata
+ id="metadata8">
+ <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>
+ <defs
+ id="defs6">
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4222">
+ <stop
+ style="stop-color:#000000;stop-opacity:1"
+ offset="0"
+ id="stop4224" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:1"
+ offset="1"
+ id="stop4226" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient4179"
+ osb:paint="gradient">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:1;"
+ offset="0"
+ id="stop4181" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.25454545"
+ offset="1"
+ id="stop4183" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4222"
+ id="linearGradient4228"
+ x1="159.38722"
+ y1="19.802504"
+ x2="212.27522"
+ y2="19.802504"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-260.32215,163.27594)" />
+ <filter
+ inkscape:collect="always"
+ style="color-interpolation-filters:sRGB"
+ id="filter4230"
+ x="-0.012"
+ width="1.024"
+ y="-0.012"
+ height="1.024">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="0.25916904"
+ id="feGaussianBlur4232" />
+ </filter>
+ <filter
+ inkscape:collect="always"
+ style="color-interpolation-filters:sRGB"
+ id="filter4371"
+ x="-0.23999999"
+ width="1.48"
+ y="-0.23999999"
+ height="1.48">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="5.2888"
+ id="feGaussianBlur4373" />
+ </filter>
+ </defs>
+ <sodipodi:namedview
+ inkscape:current-layer="layer2"
+ inkscape:window-maximized="1"
+ inkscape:window-y="0"
+ inkscape:window-x="1400"
+ inkscape:cy="61.379767"
+ inkscape:cx="10.572032"
+ inkscape:zoom="3.8530612"
+ showgrid="false"
+ id="namedview4"
+ inkscape:window-height="1024"
+ inkscape:window-width="1680"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0"
+ guidetolerance="10"
+ gridtolerance="10"
+ objecttolerance="10"
+ borderopacity="1"
+ bordercolor="#666666"
+ pagecolor="#ffffff" />
+ <g
+ inkscape:groupmode="layer"
+ id="layer1"
+ inkscape:label="PNG"
+ style="display:none"
+ sodipodi:insensitive="true"
+ transform="translate(0,-2.5)" />
+ <g
+ inkscape:groupmode="layer"
+ id="layer2"
+ inkscape:label="SVG"
+ style="display:inline"
+ transform="translate(0,-2.5)">
+ <g
+ id="g6404">
+ <circle
+ style="opacity:1;fill:#000404;fill-opacity:0.45531915;stroke:none;stroke-width:1.05419147;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;filter:url(#filter4371)"
+ id="circle4234"
+ cx="59.999996"
+ cy="66.499878"
+ r="26.444" />
+ <g
+ transform="translate(3.3103058e-6,0.33229253)"
+ id="g4148">
+ <circle
+ style="opacity:1;fill:#bdbdbd;fill-opacity:1;stroke:#bdbdbd;stroke-width:1.05419147;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path4218"
+ cx="59.999996"
+ cy="62.167587"
+ r="25.916904" />
+ <circle
+ r="25.916904"
+ cy="183.07845"
+ cx="-74.490921"
+ id="circle4220"
+ style="opacity:0.3;fill:none;fill-opacity:1;stroke:url(#linearGradient4228);stroke-width:1.05419147;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;filter:url(#filter4230)"
+ transform="matrix(0,-1,1,0,-123.07845,-12.323334)" />
+ </g>
+ </g>
+ </g>
+</svg>
diff --git a/art/md_switch_thumb_off_normal.svg b/art/md_switch_thumb_off_normal.svg
new file mode 100644
index 00000000..25d1761d
--- /dev/null
+++ b/art/md_switch_thumb_off_normal.svg
@@ -0,0 +1,153 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
+ 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:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ sodipodi:docname="md_switch_thumb_off_normal_centered.svg"
+ viewBox="0 0 120 120"
+ height="120"
+ width="120"
+ inkscape:version="0.91 r13725"
+ version="1.1"
+ id="svg2">
+ <metadata
+ id="metadata8">
+ <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>
+ <defs
+ id="defs6">
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4222">
+ <stop
+ style="stop-color:#000000;stop-opacity:1"
+ offset="0"
+ id="stop4224" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:1"
+ offset="1"
+ id="stop4226" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient4179"
+ osb:paint="gradient">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:1;"
+ offset="0"
+ id="stop4181" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.25454545"
+ offset="1"
+ id="stop4183" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4222"
+ id="linearGradient4228"
+ x1="159.38722"
+ y1="19.802504"
+ x2="212.27522"
+ y2="19.802504"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-260.32215,163.27594)" />
+ <filter
+ inkscape:collect="always"
+ style="color-interpolation-filters:sRGB"
+ id="filter4230"
+ x="-0.012"
+ width="1.024"
+ y="-0.012"
+ height="1.024">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="0.25916904"
+ id="feGaussianBlur4232" />
+ </filter>
+ <filter
+ inkscape:collect="always"
+ style="color-interpolation-filters:sRGB"
+ id="filter4371"
+ x="-0.23999999"
+ width="1.48"
+ y="-0.23999999"
+ height="1.48">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="5.2888"
+ id="feGaussianBlur4373" />
+ </filter>
+ </defs>
+ <sodipodi:namedview
+ inkscape:current-layer="layer2"
+ inkscape:window-maximized="1"
+ inkscape:window-y="0"
+ inkscape:window-x="1400"
+ inkscape:cy="61.379767"
+ inkscape:cx="10.052965"
+ inkscape:zoom="3.8530612"
+ showgrid="false"
+ id="namedview4"
+ inkscape:window-height="1024"
+ inkscape:window-width="1680"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0"
+ guidetolerance="10"
+ gridtolerance="10"
+ objecttolerance="10"
+ borderopacity="1"
+ bordercolor="#666666"
+ pagecolor="#ffffff" />
+ <g
+ inkscape:groupmode="layer"
+ id="layer1"
+ inkscape:label="PNG"
+ style="display:none"
+ sodipodi:insensitive="true"
+ transform="translate(0,-2.5)" />
+ <g
+ inkscape:groupmode="layer"
+ id="layer2"
+ inkscape:label="SVG"
+ style="display:inline"
+ transform="translate(0,-2.5)">
+ <circle
+ r="26.444"
+ cy="66.5"
+ cx="59.999996"
+ id="circle4234"
+ style="opacity:1;fill:#000404;fill-opacity:0.45531915;stroke:none;stroke-width:1.05419147;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;filter:url(#filter4371)" />
+ <g
+ id="g6390"
+ transform="translate(3.3103058e-6,-0.91758577)">
+ <circle
+ r="25.916904"
+ cy="63.417587"
+ cx="59.999996"
+ id="path4218"
+ style="opacity:1;fill:#fafafa;fill-opacity:1;stroke:#fafafa;stroke-width:1.05419147;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <circle
+ transform="matrix(0,-1,1,0,-123.07845,-11.073334)"
+ style="opacity:0.3;fill:none;fill-opacity:1;stroke:url(#linearGradient4228);stroke-width:1.05419147;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;filter:url(#filter4230)"
+ id="circle4220"
+ cx="-74.490921"
+ cy="183.07845"
+ r="25.916904" />
+ </g>
+ </g>
+</svg>
diff --git a/art/md_switch_thumb_off_pressed.svg b/art/md_switch_thumb_off_pressed.svg
new file mode 100644
index 00000000..002b4781
--- /dev/null
+++ b/art/md_switch_thumb_off_pressed.svg
@@ -0,0 +1,159 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
+ 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:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ sodipodi:docname="md_switch_thumb_off_pressed_centered.svg"
+ viewBox="0 0 120 120"
+ height="120"
+ width="120"
+ inkscape:version="0.91 r13725"
+ version="1.1"
+ id="svg2">
+ <metadata
+ id="metadata8">
+ <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>
+ <defs
+ id="defs6">
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4222">
+ <stop
+ style="stop-color:#000000;stop-opacity:1"
+ offset="0"
+ id="stop4224" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:1"
+ offset="1"
+ id="stop4226" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient4179"
+ osb:paint="gradient">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:1;"
+ offset="0"
+ id="stop4181" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.25454545"
+ offset="1"
+ id="stop4183" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4222"
+ id="linearGradient4228"
+ x1="159.38722"
+ y1="19.802504"
+ x2="212.27522"
+ y2="19.802504"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-260.32215,163.27594)" />
+ <filter
+ inkscape:collect="always"
+ style="color-interpolation-filters:sRGB"
+ id="filter4230"
+ x="-0.012"
+ width="1.024"
+ y="-0.012"
+ height="1.024">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="0.25916904"
+ id="feGaussianBlur4232" />
+ </filter>
+ <filter
+ inkscape:collect="always"
+ style="color-interpolation-filters:sRGB"
+ id="filter4371"
+ x="-0.23999999"
+ width="1.48"
+ y="-0.23999999"
+ height="1.48">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="5.2888"
+ id="feGaussianBlur4373" />
+ </filter>
+ </defs>
+ <sodipodi:namedview
+ inkscape:current-layer="layer2"
+ inkscape:window-maximized="1"
+ inkscape:window-y="0"
+ inkscape:window-x="1400"
+ inkscape:cy="61.379767"
+ inkscape:cx="10.572032"
+ inkscape:zoom="3.8530612"
+ showgrid="false"
+ id="namedview4"
+ inkscape:window-height="1024"
+ inkscape:window-width="1680"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0"
+ guidetolerance="10"
+ gridtolerance="10"
+ objecttolerance="10"
+ borderopacity="1"
+ bordercolor="#666666"
+ pagecolor="#ffffff" />
+ <g
+ inkscape:groupmode="layer"
+ id="layer1"
+ inkscape:label="PNG"
+ style="display:none"
+ sodipodi:insensitive="true"
+ transform="translate(0,-2.5)" />
+ <g
+ inkscape:groupmode="layer"
+ id="layer2"
+ inkscape:label="SVG"
+ style="display:inline"
+ transform="translate(0,-2.5)">
+ <circle
+ style="opacity:1;fill:#313131;fill-opacity:0.10196078;fill-rule:nonzero;stroke:none;stroke-width:1.00100005;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.10196078"
+ id="path4819"
+ cx="60"
+ cy="62.5"
+ r="60" />
+ <circle
+ r="26.444"
+ cy="66.5"
+ cx="59.999996"
+ id="circle4234"
+ style="opacity:1;fill:#000404;fill-opacity:0.45531915;stroke:none;stroke-width:1.05419147;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;filter:url(#filter4371)" />
+ <g
+ id="g6417"
+ transform="translate(3.3103058e-6,-0.91758577)">
+ <circle
+ r="25.916904"
+ cy="63.417587"
+ cx="59.999996"
+ id="path4218"
+ style="opacity:1;fill:#fafafa;fill-opacity:1;stroke:#fafafa;stroke-width:1.05419147;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <circle
+ transform="matrix(0,-1,1,0,-123.07845,-11.073334)"
+ style="opacity:0.3;fill:none;fill-opacity:1;stroke:url(#linearGradient4228);stroke-width:1.05419147;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;filter:url(#filter4230)"
+ id="circle4220"
+ cx="-74.490921"
+ cy="183.07845"
+ r="25.916904" />
+ </g>
+ </g>
+</svg>
diff --git a/art/md_switch_thumb_on_normal.svg b/art/md_switch_thumb_on_normal.svg
new file mode 100644
index 00000000..5e8f90f3
--- /dev/null
+++ b/art/md_switch_thumb_on_normal.svg
@@ -0,0 +1,146 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
+ 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:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ sodipodi:docname="md_switch_thumb_on_normal_centered_square.svg"
+ viewBox="0 0 120 120"
+ height="120"
+ width="120"
+ inkscape:version="0.91 r13725"
+ version="1.1"
+ id="svg2">
+ <metadata
+ id="metadata8">
+ <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>
+ <defs
+ id="defs6">
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4222">
+ <stop
+ style="stop-color:#000000;stop-opacity:1"
+ offset="0"
+ id="stop4224" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:1"
+ offset="1"
+ id="stop4226" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient4179"
+ osb:paint="gradient">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:1;"
+ offset="0"
+ id="stop4181" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.25454545"
+ offset="1"
+ id="stop4183" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4222"
+ id="linearGradient4228"
+ x1="159.38722"
+ y1="19.802504"
+ x2="212.27522"
+ y2="19.802504"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-260.32215,163.27594)" />
+ <filter
+ inkscape:collect="always"
+ style="color-interpolation-filters:sRGB"
+ id="filter4230"
+ x="-0.012"
+ width="1.024"
+ y="-0.012"
+ height="1.024">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="0.25916904"
+ id="feGaussianBlur4232" />
+ </filter>
+ <filter
+ inkscape:collect="always"
+ style="color-interpolation-filters:sRGB"
+ id="filter4371"
+ x="-0.23999999"
+ width="1.48"
+ y="-0.23999999"
+ height="1.48">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="5.2888"
+ id="feGaussianBlur4373" />
+ </filter>
+ </defs>
+ <sodipodi:namedview
+ inkscape:current-layer="layer2"
+ inkscape:window-maximized="1"
+ inkscape:window-y="0"
+ inkscape:window-x="1400"
+ inkscape:cy="61.379767"
+ inkscape:cx="-14.397519"
+ inkscape:zoom="3.8530612"
+ showgrid="false"
+ id="namedview4"
+ inkscape:window-height="1024"
+ inkscape:window-width="1680"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0"
+ guidetolerance="10"
+ gridtolerance="10"
+ objecttolerance="10"
+ borderopacity="1"
+ bordercolor="#666666"
+ pagecolor="#ffffff" />
+ <g
+ inkscape:groupmode="layer"
+ id="layer2"
+ inkscape:label="SVG"
+ style="display:inline"
+ transform="translate(0,-2.5)">
+ <circle
+ r="26.444"
+ cy="66.499878"
+ cx="59.999996"
+ id="circle4234"
+ style="opacity:1;fill:#000404;fill-opacity:0.45531915;stroke:none;stroke-width:1.05419147;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;filter:url(#filter4371)" />
+ <g
+ id="g6440"
+ transform="translate(3.3103058e-6,0.33241423)">
+ <circle
+ r="25.916904"
+ cy="62.167587"
+ cx="59.999996"
+ id="path4218"
+ style="opacity:1;fill:#0091ea;fill-opacity:1;stroke:#0091ea;stroke-width:1.05419147;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ <circle
+ transform="matrix(0,-1,1,0,-123.07845,-12.323334)"
+ style="opacity:0.3;fill:none;fill-opacity:1;stroke:url(#linearGradient4228);stroke-width:1.05419147;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;filter:url(#filter4230)"
+ id="circle4220"
+ cx="-74.490921"
+ cy="183.07845"
+ r="25.916904" />
+ </g>
+ </g>
+</svg>
diff --git a/art/md_switch_thumb_on_pressed.svg b/art/md_switch_thumb_on_pressed.svg
new file mode 100644
index 00000000..e0331e7b
--- /dev/null
+++ b/art/md_switch_thumb_on_pressed.svg
@@ -0,0 +1,162 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
+ 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:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ sodipodi:docname="md_switch_thumb_on_pressed_centered_square.svg"
+ viewBox="0 0 120 120"
+ height="120"
+ width="120"
+ inkscape:version="0.91 r13725"
+ version="1.1"
+ id="svg2">
+ <metadata
+ id="metadata8">
+ <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>
+ <defs
+ id="defs6">
+ <linearGradient
+ inkscape:collect="always"
+ id="linearGradient4222">
+ <stop
+ style="stop-color:#000000;stop-opacity:1"
+ offset="0"
+ id="stop4224" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:1"
+ offset="1"
+ id="stop4226" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient4179"
+ osb:paint="gradient">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:1;"
+ offset="0"
+ id="stop4181" />
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.25454545"
+ offset="1"
+ id="stop4183" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient4222"
+ id="linearGradient4228"
+ x1="159.38722"
+ y1="19.802504"
+ x2="212.27522"
+ y2="19.802504"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-260.32215,163.27594)" />
+ <filter
+ inkscape:collect="always"
+ style="color-interpolation-filters:sRGB"
+ id="filter4230"
+ x="-0.012"
+ width="1.024"
+ y="-0.012"
+ height="1.024">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="0.25916904"
+ id="feGaussianBlur4232" />
+ </filter>
+ <filter
+ inkscape:collect="always"
+ style="color-interpolation-filters:sRGB"
+ id="filter4371"
+ x="-0.23999999"
+ width="1.48"
+ y="-0.23999999"
+ height="1.48">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="5.2888"
+ id="feGaussianBlur4373" />
+ </filter>
+ </defs>
+ <sodipodi:namedview
+ inkscape:current-layer="layer2"
+ inkscape:window-maximized="1"
+ inkscape:window-y="0"
+ inkscape:window-x="1400"
+ inkscape:cy="61.379767"
+ inkscape:cx="-46.31369"
+ inkscape:zoom="3.8530612"
+ showgrid="false"
+ id="namedview4"
+ inkscape:window-height="1024"
+ inkscape:window-width="1680"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0"
+ guidetolerance="10"
+ gridtolerance="10"
+ objecttolerance="10"
+ borderopacity="1"
+ bordercolor="#666666"
+ pagecolor="#ffffff" />
+ <g
+ inkscape:groupmode="layer"
+ id="layer1"
+ inkscape:label="PNG"
+ style="display:none"
+ sodipodi:insensitive="true"
+ transform="translate(0,-2.5)" />
+ <g
+ inkscape:groupmode="layer"
+ id="layer2"
+ inkscape:label="SVG"
+ style="display:inline"
+ transform="translate(0,-2.5)">
+ <circle
+ style="opacity:1;fill:#0093e8;fill-opacity:0.10196078;fill-rule:nonzero;stroke:none;stroke-width:1.00100005;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.10196078"
+ id="path4819"
+ cx="60"
+ cy="62.5"
+ r="60" />
+ <g
+ id="g4156">
+ <circle
+ style="opacity:1;fill:#000404;fill-opacity:0.45531915;stroke:none;stroke-width:1.05419147;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;filter:url(#filter4371)"
+ id="circle4234"
+ cx="59.999996"
+ cy="66.5"
+ r="26.444" />
+ <g
+ transform="translate(3.3103058e-6,0.33241423)"
+ id="g4149">
+ <circle
+ style="opacity:1;fill:#0091ea;fill-opacity:1;stroke:#0091ea;stroke-width:1.05419147;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path4218"
+ cx="59.999996"
+ cy="62.167587"
+ r="25.916904" />
+ <circle
+ r="25.916904"
+ cy="183.07845"
+ cx="-74.490921"
+ id="circle4220"
+ style="opacity:0.3;fill:none;fill-opacity:1;stroke:url(#linearGradient4228);stroke-width:1.05419147;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;filter:url(#filter4230)"
+ transform="matrix(0,-1,1,0,-123.07845,-12.323334)" />
+ </g>
+ </g>
+ </g>
+</svg>
diff --git a/art/render.rb b/art/render.rb
index 698abea5..312dd06b 100755
--- a/art/render.rb
+++ b/art/render.rb
@@ -33,7 +33,12 @@ images = {
'ic_send_picture_online.svg' => ['ic_send_picture_online', 36],
'ic_send_picture_offline.svg' => ['ic_send_picture_offline', 36],
'ic_send_picture_away.svg' => ['ic_send_picture_away', 36],
- 'ic_send_picture_dnd.svg' => ['ic_send_picture_dnd', 36]
+ 'ic_send_picture_dnd.svg' => ['ic_send_picture_dnd', 36],
+ 'md_switch_thumb_disable.svg' => ['switch_thumb_disable', 48],
+ 'md_switch_thumb_off_normal.svg' => ['switch_thumb_off_normal', 48],
+ 'md_switch_thumb_off_pressed.svg' => ['switch_thumb_off_pressed', 48],
+ 'md_switch_thumb_on_normal.svg' => ['switch_thumb_on_normal', 48],
+ 'md_switch_thumb_on_pressed.svg' => ['switch_thumb_on_pressed', 48],
}
images.each do |source, result|
resolutions.each do |name, factor|
diff --git a/build.gradle b/build.gradle
index 4e23c522..09ad7161 100644
--- a/build.gradle
+++ b/build.gradle
@@ -36,6 +36,7 @@ dependencies {
compile 'de.measite.minidns:minidns:0.1.3'
compile 'de.timroes.android:EnhancedListView:0.3.4'
compile 'me.leolin:ShortcutBadger:1.1.1@aar'
+ compile 'com.kyleduo.switchbutton:library:1.2.8'
}
android {
diff --git a/src/main/java/eu/siacs/conversations/ui/adapter/AccountAdapter.java b/src/main/java/eu/siacs/conversations/ui/adapter/AccountAdapter.java
index 782a1231..226b1920 100644
--- a/src/main/java/eu/siacs/conversations/ui/adapter/AccountAdapter.java
+++ b/src/main/java/eu/siacs/conversations/ui/adapter/AccountAdapter.java
@@ -6,6 +6,8 @@ import eu.siacs.conversations.R;
import eu.siacs.conversations.entities.Account;
import eu.siacs.conversations.ui.XmppActivity;
import eu.siacs.conversations.ui.ManageAccountActivity;
+import eu.siacs.conversations.ui.widget.Switch;
+
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
@@ -14,7 +16,6 @@ import android.widget.ArrayAdapter;
import android.widget.CompoundButton;
import android.widget.ImageView;
import android.widget.TextView;
-import android.widget.Switch;
public class AccountAdapter extends ArrayAdapter<Account> {
@@ -53,8 +54,7 @@ public class AccountAdapter extends ArrayAdapter<Account> {
}
final Switch tglAccountState = (Switch) view.findViewById(R.id.tgl_account_status);
final boolean isDisabled = (account.getStatus() == Account.State.DISABLED);
- tglAccountState.setOnCheckedChangeListener(null);
- tglAccountState.setChecked(!isDisabled);
+ tglAccountState.setChecked(!isDisabled,false);
tglAccountState.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
diff --git a/src/main/java/eu/siacs/conversations/ui/widget/Switch.java b/src/main/java/eu/siacs/conversations/ui/widget/Switch.java
new file mode 100644
index 00000000..c72e760e
--- /dev/null
+++ b/src/main/java/eu/siacs/conversations/ui/widget/Switch.java
@@ -0,0 +1,70 @@
+package eu.siacs.conversations.ui.widget;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.view.MotionEvent;
+import android.view.ViewConfiguration;
+
+import com.kyleduo.switchbutton.SwitchButton;
+
+import eu.siacs.conversations.Config;
+
+public class Switch extends SwitchButton {
+
+ private int mTouchSlop;
+ private int mClickTimeout;
+ private float mStartX;
+ private float mStartY;
+ private OnClickListener mOnClickListener;
+
+ public Switch(Context context) {
+ super(context);
+ mTouchSlop = ViewConfiguration.get(getContext()).getScaledTouchSlop();
+ mClickTimeout = ViewConfiguration.getPressedStateDuration() + ViewConfiguration.getTapTimeout();
+ }
+
+ public Switch(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ mTouchSlop = ViewConfiguration.get(getContext()).getScaledTouchSlop();
+ mClickTimeout = ViewConfiguration.getPressedStateDuration() + ViewConfiguration.getTapTimeout();
+ }
+
+ public Switch(Context context, AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+ mTouchSlop = ViewConfiguration.get(getContext()).getScaledTouchSlop();
+ mClickTimeout = ViewConfiguration.getPressedStateDuration() + ViewConfiguration.getTapTimeout();
+ }
+
+ @Override
+ public void setOnClickListener(OnClickListener onClickListener) {
+ this.mOnClickListener = onClickListener;
+ }
+
+ @Override
+ public boolean onTouchEvent(MotionEvent event) {
+ if (!isEnabled()) {
+ float deltaX = event.getX() - mStartX;
+ float deltaY = event.getY() - mStartY;
+ int action = event.getAction();
+ switch (action) {
+ case MotionEvent.ACTION_DOWN:
+ mStartX = event.getX();
+ mStartY = event.getY();
+ break;
+ case MotionEvent.ACTION_CANCEL:
+ case MotionEvent.ACTION_UP:
+ float time = event.getEventTime() - event.getDownTime();
+ if (deltaX < mTouchSlop && deltaY < mTouchSlop && time < mClickTimeout) {
+ if (mOnClickListener != null) {
+ this.mOnClickListener.onClick(this);
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ return true;
+ }
+ return super.onTouchEvent(event);
+ }
+}
diff --git a/src/main/res/drawable-hdpi/switch_thumb_disable.png b/src/main/res/drawable-hdpi/switch_thumb_disable.png
new file mode 100644
index 00000000..1e9b151b
--- /dev/null
+++ b/src/main/res/drawable-hdpi/switch_thumb_disable.png
Binary files differ
diff --git a/src/main/res/drawable-hdpi/switch_thumb_off_normal.png b/src/main/res/drawable-hdpi/switch_thumb_off_normal.png
new file mode 100644
index 00000000..b7c1fc11
--- /dev/null
+++ b/src/main/res/drawable-hdpi/switch_thumb_off_normal.png
Binary files differ
diff --git a/src/main/res/drawable-hdpi/switch_thumb_off_pressed.png b/src/main/res/drawable-hdpi/switch_thumb_off_pressed.png
new file mode 100644
index 00000000..ca6e4909
--- /dev/null
+++ b/src/main/res/drawable-hdpi/switch_thumb_off_pressed.png
Binary files differ
diff --git a/src/main/res/drawable-hdpi/switch_thumb_on_normal.png b/src/main/res/drawable-hdpi/switch_thumb_on_normal.png
new file mode 100644
index 00000000..cbcda5d4
--- /dev/null
+++ b/src/main/res/drawable-hdpi/switch_thumb_on_normal.png
Binary files differ
diff --git a/src/main/res/drawable-hdpi/switch_thumb_on_pressed.png b/src/main/res/drawable-hdpi/switch_thumb_on_pressed.png
new file mode 100644
index 00000000..234b12dc
--- /dev/null
+++ b/src/main/res/drawable-hdpi/switch_thumb_on_pressed.png
Binary files differ
diff --git a/src/main/res/drawable-mdpi/switch_thumb_disable.png b/src/main/res/drawable-mdpi/switch_thumb_disable.png
new file mode 100644
index 00000000..968de345
--- /dev/null
+++ b/src/main/res/drawable-mdpi/switch_thumb_disable.png
Binary files differ
diff --git a/src/main/res/drawable-mdpi/switch_thumb_off_normal.png b/src/main/res/drawable-mdpi/switch_thumb_off_normal.png
new file mode 100644
index 00000000..51fb4d7a
--- /dev/null
+++ b/src/main/res/drawable-mdpi/switch_thumb_off_normal.png
Binary files differ
diff --git a/src/main/res/drawable-mdpi/switch_thumb_off_pressed.png b/src/main/res/drawable-mdpi/switch_thumb_off_pressed.png
new file mode 100644
index 00000000..ca788445
--- /dev/null
+++ b/src/main/res/drawable-mdpi/switch_thumb_off_pressed.png
Binary files differ
diff --git a/src/main/res/drawable-mdpi/switch_thumb_on_normal.png b/src/main/res/drawable-mdpi/switch_thumb_on_normal.png
new file mode 100644
index 00000000..6a93d5f7
--- /dev/null
+++ b/src/main/res/drawable-mdpi/switch_thumb_on_normal.png
Binary files differ
diff --git a/src/main/res/drawable-mdpi/switch_thumb_on_pressed.png b/src/main/res/drawable-mdpi/switch_thumb_on_pressed.png
new file mode 100644
index 00000000..e8d7bd0f
--- /dev/null
+++ b/src/main/res/drawable-mdpi/switch_thumb_on_pressed.png
Binary files differ
diff --git a/src/main/res/drawable-xhdpi/switch_thumb_disable.png b/src/main/res/drawable-xhdpi/switch_thumb_disable.png
new file mode 100644
index 00000000..7f677324
--- /dev/null
+++ b/src/main/res/drawable-xhdpi/switch_thumb_disable.png
Binary files differ
diff --git a/src/main/res/drawable-xhdpi/switch_thumb_off_normal.png b/src/main/res/drawable-xhdpi/switch_thumb_off_normal.png
new file mode 100644
index 00000000..4199d322
--- /dev/null
+++ b/src/main/res/drawable-xhdpi/switch_thumb_off_normal.png
Binary files differ
diff --git a/src/main/res/drawable-xhdpi/switch_thumb_off_pressed.png b/src/main/res/drawable-xhdpi/switch_thumb_off_pressed.png
new file mode 100644
index 00000000..2b86888f
--- /dev/null
+++ b/src/main/res/drawable-xhdpi/switch_thumb_off_pressed.png
Binary files differ
diff --git a/src/main/res/drawable-xhdpi/switch_thumb_on_normal.png b/src/main/res/drawable-xhdpi/switch_thumb_on_normal.png
new file mode 100644
index 00000000..daa30990
--- /dev/null
+++ b/src/main/res/drawable-xhdpi/switch_thumb_on_normal.png
Binary files differ
diff --git a/src/main/res/drawable-xhdpi/switch_thumb_on_pressed.png b/src/main/res/drawable-xhdpi/switch_thumb_on_pressed.png
new file mode 100644
index 00000000..6aab47c9
--- /dev/null
+++ b/src/main/res/drawable-xhdpi/switch_thumb_on_pressed.png
Binary files differ
diff --git a/src/main/res/drawable-xxhdpi/switch_thumb_disable.png b/src/main/res/drawable-xxhdpi/switch_thumb_disable.png
new file mode 100644
index 00000000..db7c1df4
--- /dev/null
+++ b/src/main/res/drawable-xxhdpi/switch_thumb_disable.png
Binary files differ
diff --git a/src/main/res/drawable-xxhdpi/switch_thumb_off_normal.png b/src/main/res/drawable-xxhdpi/switch_thumb_off_normal.png
new file mode 100644
index 00000000..f747b559
--- /dev/null
+++ b/src/main/res/drawable-xxhdpi/switch_thumb_off_normal.png
Binary files differ
diff --git a/src/main/res/drawable-xxhdpi/switch_thumb_off_pressed.png b/src/main/res/drawable-xxhdpi/switch_thumb_off_pressed.png
new file mode 100644
index 00000000..b9fe6d46
--- /dev/null
+++ b/src/main/res/drawable-xxhdpi/switch_thumb_off_pressed.png
Binary files differ
diff --git a/src/main/res/drawable-xxhdpi/switch_thumb_on_normal.png b/src/main/res/drawable-xxhdpi/switch_thumb_on_normal.png
new file mode 100644
index 00000000..88199024
--- /dev/null
+++ b/src/main/res/drawable-xxhdpi/switch_thumb_on_normal.png
Binary files differ
diff --git a/src/main/res/drawable-xxhdpi/switch_thumb_on_pressed.png b/src/main/res/drawable-xxhdpi/switch_thumb_on_pressed.png
new file mode 100644
index 00000000..7a4fed54
--- /dev/null
+++ b/src/main/res/drawable-xxhdpi/switch_thumb_on_pressed.png
Binary files differ
diff --git a/src/main/res/drawable-xxxhdpi/switch_thumb_disable.png b/src/main/res/drawable-xxxhdpi/switch_thumb_disable.png
new file mode 100644
index 00000000..3970168c
--- /dev/null
+++ b/src/main/res/drawable-xxxhdpi/switch_thumb_disable.png
Binary files differ
diff --git a/src/main/res/drawable-xxxhdpi/switch_thumb_off_normal.png b/src/main/res/drawable-xxxhdpi/switch_thumb_off_normal.png
new file mode 100644
index 00000000..ea8d4f89
--- /dev/null
+++ b/src/main/res/drawable-xxxhdpi/switch_thumb_off_normal.png
Binary files differ
diff --git a/src/main/res/drawable-xxxhdpi/switch_thumb_off_pressed.png b/src/main/res/drawable-xxxhdpi/switch_thumb_off_pressed.png
new file mode 100644
index 00000000..84d667b1
--- /dev/null
+++ b/src/main/res/drawable-xxxhdpi/switch_thumb_off_pressed.png
Binary files differ
diff --git a/src/main/res/drawable-xxxhdpi/switch_thumb_on_normal.png b/src/main/res/drawable-xxxhdpi/switch_thumb_on_normal.png
new file mode 100644
index 00000000..06b190eb
--- /dev/null
+++ b/src/main/res/drawable-xxxhdpi/switch_thumb_on_normal.png
Binary files differ
diff --git a/src/main/res/drawable-xxxhdpi/switch_thumb_on_pressed.png b/src/main/res/drawable-xxxhdpi/switch_thumb_on_pressed.png
new file mode 100644
index 00000000..79c30d1e
--- /dev/null
+++ b/src/main/res/drawable-xxxhdpi/switch_thumb_on_pressed.png
Binary files differ
diff --git a/src/main/res/drawable/switch_back_off.xml b/src/main/res/drawable/switch_back_off.xml
new file mode 100644
index 00000000..20d2fb14
--- /dev/null
+++ b/src/main/res/drawable/switch_back_off.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <item android:state_enabled="false"><shape android:shape="rectangle">
+ <solid android:color="#D5D5D5" />
+
+ <corners android:radius="99dp" />
+ </shape></item>
+ <item android:state_enabled="true"><shape android:shape="rectangle">
+ <solid android:color="#939393" />
+
+ <corners android:radius="99dp" />
+ </shape></item>
+
+</selector> \ No newline at end of file
diff --git a/src/main/res/drawable/switch_back_on.xml b/src/main/res/drawable/switch_back_on.xml
new file mode 100644
index 00000000..45117a98
--- /dev/null
+++ b/src/main/res/drawable/switch_back_on.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_enabled="false">
+ <shape android:shape="rectangle">
+ <solid android:color="#D5D5D5"/>
+ <corners android:radius="99dp"/>
+ </shape>
+ </item>
+ <item android:state_enabled="true">
+ <shape android:shape="rectangle">
+ <!-- 30% accent on white -->
+ <solid android:color="#b3ddf7"/>
+ <corners android:radius="99dp"/>
+ </shape>
+ </item>
+</selector> \ No newline at end of file
diff --git a/src/main/res/drawable/switch_thumb.xml b/src/main/res/drawable/switch_thumb.xml
new file mode 100644
index 00000000..ba3d1c45
--- /dev/null
+++ b/src/main/res/drawable/switch_thumb.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <item android:drawable="@drawable/switch_thumb_disable" android:state_enabled="false"/>
+ <item android:drawable="@drawable/switch_thumb_on_pressed" android:state_checked="true" android:state_pressed="true"/>
+ <item android:drawable="@drawable/switch_thumb_on_pressed" android:state_checked="true" android:state_focused="true"/>
+ <item android:drawable="@drawable/switch_thumb_on_normal" android:state_checked="true"/>
+ <item android:drawable="@drawable/switch_thumb_off_pressed" android:state_checked="false" android:state_pressed="true"/>
+ <item android:drawable="@drawable/switch_thumb_off_pressed" android:state_checked="false" android:state_focused="true"/>
+ <item android:drawable="@drawable/switch_thumb_off_normal" android:state_checked="false"/>
+
+</selector> \ No newline at end of file
diff --git a/src/main/res/layout/account_row.xml b/src/main/res/layout/account_row.xml
index 06716a10..077170b2 100644
--- a/src/main/res/layout/account_row.xml
+++ b/src/main/res/layout/account_row.xml
@@ -45,13 +45,14 @@
android:textStyle="bold" />
</LinearLayout>
- <Switch
+ <eu.siacs.conversations.ui.widget.Switch
+ style="@style/MD"
android:id="@+id/tgl_account_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
- android:padding="8dp"
+ android:padding="16dp"
android:focusable="false"/>
</RelativeLayout> \ No newline at end of file
diff --git a/src/main/res/values/styles.xml b/src/main/res/values/styles.xml
index b98a37fc..e8572d9d 100644
--- a/src/main/res/values/styles.xml
+++ b/src/main/res/values/styles.xml
@@ -4,8 +4,18 @@
<item name="android:layout_height">1.5dp</item>
<item name="android:background">@color/black12</item>
</style>
- <style name="Tag">
-
+ <style name="MD">
+ <item name="animationVelocity">6</item>
+ <item name="insetBottom">16dp</item>
+ <item name="insetTop">16dp</item>
+ <item name="insetLeft">16dp</item>
+ <item name="insetRight">16dp</item>
+ <item name="measureFactor">1.4</item>
+ <item name="offDrawable">@drawable/switch_back_off</item>
+ <item name="onDrawable">@drawable/switch_back_on</item>
+ <item name="thumbDrawable">@drawable/switch_thumb</item>
+ <item name="thumb_margin">-17dp</item>
+ <item name="android:padding">16dp</item>
</style>
</resources> \ No newline at end of file