From 41afd552e98ce54ce6cfd11e9a8841c8aa5a43bc Mon Sep 17 00:00:00 2001 From: Andreas Straub Date: Sun, 3 Jan 2016 18:12:51 +0100 Subject: Clean up Conversations logo SVG The previous version of the logo had some wonky alignments and other artifacts in some places on the dashed line. This commit provides a new version of the logo with perfect alignments. It also includes a single path for the dashed line, which can be used to ease further modifications to the logo. --- art/conversations_baloon.svg | 52 ++++++++++++++++++++++++++++---------------- 1 file changed, 33 insertions(+), 19 deletions(-) diff --git a/art/conversations_baloon.svg b/art/conversations_baloon.svg index 140a84c7c..d45aa09e5 100644 --- a/art/conversations_baloon.svg +++ b/art/conversations_baloon.svg @@ -234,16 +234,16 @@ inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="1.4142136" - inkscape:cx="385.13513" - inkscape:cy="237.84331" + inkscape:cx="170.65814" + inkscape:cy="315.04933" inkscape:document-units="px" - inkscape:current-layer="layer4" + inkscape:current-layer="layer1" showgrid="false" - inkscape:window-width="2560" - inkscape:window-height="1020" + inkscape:window-width="1971" + inkscape:window-height="1419" inkscape:window-x="0" - inkscape:window-y="27" - inkscape:window-maximized="1" + inkscape:window-y="0" + inkscape:window-maximized="0" showguides="true" inkscape:guide-bbox="true" inkscape:snap-to-guides="true" @@ -313,7 +313,7 @@ + + + + style="opacity:0.5;fill:#ffffff;fill-opacity:1;stroke:none" + d="m 253.09375,17.71875 c -1.84358,9.5e-4 -3.66661,0.02154 -5.5,0.0625 -1.31562,0.03101 -2.6273,0.0724 -3.9375,0.125 -0.51882,0.02051 -1.04454,0.03829 -1.5625,0.0625 -0.0104,4.85e-4 -0.0209,-4.86e-4 -0.0312,0 -0.0219,0.0068 -0.0409,0.02236 -0.0625,0.03125 -0.0104,-3.2e-5 -0.0208,-3.2e-5 -0.0312,0 l -0.375,0 c -0.0726,0.0035 -0.1462,-0.0036 -0.21875,0 -0.0629,0.005 -0.1248,0.02385 -0.1875,0.03125 -0.0208,-1.3e-4 -0.0417,-1.3e-4 -0.0625,0 l -0.25,0.03125 -5.09375,0.3125 -0.0937,0 c -0.0619,0.0046 -0.12557,-0.0046 -0.1875,0 -0.0526,0.0049 -0.10384,0.02465 -0.15625,0.03125 l -5.0625,0.46875 -0.21875,0 c -0.18792,-1.66e-4 -0.37575,0.01027 -0.5625,0.03125 l -5.4375,0.625 c -0.0522,0.0096 -0.10434,0.02 -0.15625,0.03125 l -0.15625,0.03125 0,-0.03125 c -1.14812,0.144008 -2.29463,0.308211 -3.4375,0.46875 -0.43536,0.06115 -0.87792,0.09271 -1.3125,0.15625 l -0.65625,0.09375 c -0.0624,0.0093 -0.12509,0.02189 -0.1875,0.03125 l -0.0937,0.03125 c -0.0312,-2.93e-4 -0.0625,-2.93e-4 -0.0937,0 -0.10529,0.01587 -0.20726,0.04649 -0.3125,0.0625 -1.68335,0.256738 -3.35934,0.52069 -5.03125,0.8125 L 212.5,21.25 c -0.0726,0.0127 -0.14623,0.01848 -0.21875,0.03125 l -5.3125,1 c -0.0519,0.01038 -0.10435,0.02083 -0.15625,0.03125 -0.0419,0.0094 -0.0834,0.02073 -0.125,0.03125 -0.0522,0.0096 -0.10434,0.02 -0.15625,0.03125 l -0.21875,0.0625 c -0.74279,0.150808 -1.47855,0.310944 -2.21875,0.46875 -0.95821,0.204284 -1.92122,0.37781 -2.875,0.59375 -0.0613,0.01537 -0.12685,0.01357 -0.1875,0.03125 l -0.21875,0.0625 c -1.68856,0.385486 -3.35697,0.797064 -5.03125,1.21875 -0.0318,0.008 -0.0619,0.02322 -0.0937,0.03125 L 195.5313,24.875 c -1.19261,0.301778 -2.37672,0.620979 -3.5625,0.9375 -0.66592,0.179777 -1.33648,0.345774 -2,0.53125 l -0.5,0.15625 -4.5625,1.34375 c -0.0506,0.01538 -0.1057,0.01584 -0.15625,0.03125 l -0.0625,0 c -0.61602,0.188019 -1.22994,0.400811 -1.84375,0.59375 -1.165,0.366192 -2.34305,0.741209 -3.5,1.125 -1.11506,0.369896 -2.20992,0.763325 -3.3125,1.15625 -1.10258,0.392925 -2.21287,0.785345 -3.3125,1.1875 -1.76931,1.208779 -2.74275,3.587224 -2.09375,5.65625 l 5.71875,18 c 0.78134,2.492635 3.75455,4.053571 6.25,3.28125 l 9,-2.84375 C 191.6042,56.02088 191.6147,56.01046 191.625,56 l 1.3125,-0.40625 0.15625,-0.0625 0.0625,0 c 0.0105,-0.01037 0.0209,-0.02079 0.0312,-0.03125 l 4.1875,-1.21875 c 0.17979,-0.04222 0.35723,-0.09441 0.53125,-0.15625 l 0.28125,-0.0625 c 0.0524,-0.01996 0.10452,-0.04079 0.15625,-0.0625 l 4.5,-1.15625 c 0.0947,-0.02846 0.18845,-0.05973 0.28125,-0.09375 0.0629,-0.0196 0.12542,-0.04043 0.1875,-0.0625 l 4.40625,-1 c 0.11565,-0.02715 0.23033,-0.05843 0.34375,-0.09375 0.0418,-0.0099 0.0835,-0.0203 0.125,-0.03125 l 4.21875,-0.875 c 0.042,-0.02025 0.0836,-0.04109 0.125,-0.0625 l 0.25,-0.03125 0.0625,-0.03125 4.34375,-0.8125 0.1875,-0.03125 0.0312,0 c 0.0208,1.3e-4 0.0417,1.3e-4 0.0625,0 l 4.71875,-0.75 0.15625,-0.03125 0.0937,0 c 0.0209,-0.01027 0.0417,-0.02069 0.0625,-0.03125 l 4.34375,-0.625 0.21875,0 c 0.14666,-0.01437 0.29268,-0.03523 0.4375,-0.0625 l 0.34375,-0.03125 c 0.0104,3.2e-5 0.0208,3.2e-5 0.0312,0 l 4.8125,-0.53125 c 0.19956,-0.01931 0.39795,-0.05063 0.59375,-0.09375 l 4.28125,-0.34375 c 0.0521,8.14e-4 0.10417,8.14e-4 0.15625,0 l 0.0625,0 0.25,-0.03125 4.65625,-0.28125 c 0.0208,1.3e-4 0.0417,1.3e-4 0.0625,0 0.0417,5.21e-4 0.0833,5.21e-4 0.125,0 l 4.875,-0.1875 0.1875,0 0.0625,0 c 0.0208,1.3e-4 0.0417,1.3e-4 0.0625,0 l 5.03125,-0.0625 0.0625,0 0.0937,0 0.0625,0 0.0312,0 4.0625,0.03125 0.0312,0 9.40625,0.125 c 2.61798,0.03267 5.02972,-2.319522 5.0625,-4.9375 l 0.25,-18.90625 c 0.0259,-2.074769 -1.45994,-3.984516 -3.375,-4.71875 -3.66186,-0.240005 -7.35593,-0.392164 -11.0625,-0.46875 -1.45657,-0.02746 -2.91209,-0.06173 -4.375,-0.0625 -0.0418,-2.2e-5 -0.0832,0 -0.125,0 l -0.0625,0 -0.0625,0 z m 112.84375,29.5625 c -1.61634,0.09054 -3.16266,1.020745 -4,2.40625 l -9.84375,16.125 c -1.34693,2.228501 -0.56059,5.477714 1.65625,6.84375 l 8.0625,4.9375 c 0.0208,0.01056 0.0416,0.02098 0.0625,0.03125 0.031,0.02118 0.0623,0.04202 0.0937,0.0625 l 0.0937,0.0625 c 0.031,0.02118 0.0623,0.04202 0.0937,0.0625 l 0.0312,0 3.625,2.3125 0.125,0.09375 0.1875,0.125 c 0.0208,0.01056 0.0416,0.02098 0.0625,0.03125 0.0916,0.06565 0.18542,0.128193 0.28125,0.1875 l 3.625,2.46875 c 0.0104,0.01046 0.0208,0.02088 0.0312,0.03125 l 0.0312,0.03125 0.15625,0.09375 3.65625,2.65625 c 0.0414,0.02141 0.083,0.04225 0.125,0.0625 0.0103,0.01046 0.0208,0.02088 0.0312,0.03125 l 0.1875,0.125 3.625,2.71875 0.0937,0.09375 c 0.13067,0.100367 0.26631,0.194269 0.40625,0.28125 l 3.1875,2.53125 c 0.0104,0.01046 0.0208,0.02088 0.0312,0.03125 0.0208,0.01056 0.0416,0.02098 0.0625,0.03125 0.0206,0.02102 0.0415,0.04185 0.0625,0.0625 l 0.125,0.09375 3.09375,2.53125 0.15625,0.15625 0.1875,0.15625 c 0.0308,0.03166 0.062,0.06292 0.0937,0.09375 l 3.28125,2.8125 0.0625,0.0625 0.0937,0.09375 0.125,0.09375 c 0.0102,0.02091 0.0206,0.04174 0.0312,0.0625 l 3.3125,3 0.15625,0.15625 c 0.0308,0.0316 0.062,0.0631 0.0937,0.0937 l 3.3125,3.125 0.0937,0.0937 0.0312,0.0312 0.0312,0.0312 3,2.96875 0.15625,0.1875 0.15625,0.15625 c 0.0205,0.0315 0.0413,0.0627 0.0625,0.0937 l 3.21875,3.375 c 0.0207,0.021 0.0415,0.0418 0.0625,0.0625 l 0.0312,0.0312 0.15625,0.15625 2.8125,3.125 0.125,0.15625 0.0312,0.0312 c 0.0205,0.0315 0.0413,0.0627 0.0625,0.0937 L 409,118.46875 c 0.0208,0.0105 0.0416,0.0209 0.0625,0.0312 0.0604,0.0747 0.12292,0.14765 0.1875,0.21875 l 1.96875,2.4375 c 0.0104,0.0105 0.0208,0.0208 0.0312,0.0312 l 6.03125,7.3125 c 1.67116,2.00946 5.01709,2.32174 7.03125,0.65625 l 14.5938,-12.03115 c 1.54313,-1.28334 2.05441,-3.54043 1.46875,-5.4375 -1.33496,-1.81082 -2.70665,-3.60416 -4.09375,-5.375 -1.08053,-1.37946 -2.1696,-2.73927 -3.28125,-4.09375 -0.59142,-0.71955 -1.18107,-1.44398 -1.78125,-2.15625 -0.0283,-0.0337 -0.0654,-0.0601 -0.0937,-0.09375 -1.14358,-1.355587 -2.29385,-2.702475 -3.46875,-4.03125 -0.0343,-0.03889 -0.0594,-0.08613 -0.0937,-0.125 -1.21028,-1.366915 -2.44467,-2.724592 -3.6875,-4.0625 -0.0901,-0.09715 -0.19102,-0.184251 -0.28125,-0.28125 -0.16082,-0.172519 -0.3074,-0.359222 -0.46875,-0.53125 -0.99833,-1.066598 -2.0125,-2.108657 -3.03125,-3.15625 -0.55,-0.564473 -1.10038,-1.128616 -1.65625,-1.6875 -0.73075,-0.736075 -1.4779,-1.461254 -2.21875,-2.1875 -0.87246,-0.853771 -1.73879,-1.69117 -2.625,-2.53125 -0.47827,-0.454135 -0.95523,-0.89369 -1.4375,-1.34375 -1.17008,-1.090289 -2.33812,-2.183697 -3.53125,-3.25 -0.13193,-0.118044 -0.27404,-0.226006 -0.40625,-0.34375 -1.36693,-1.215971 -2.75983,-2.44099 -4.15625,-3.625 -0.1804,-0.15296 -0.35036,-0.316329 -0.53125,-0.46875 L 400.3125,69.6875 c -0.15502,-0.125906 -0.31338,-0.249485 -0.46875,-0.375 -1.1203,-0.905053 -2.26844,-1.802884 -3.40625,-2.6875 -0.31145,-0.24207 -0.62474,-0.478228 -0.9375,-0.71875 -1.45358,-1.118313 -2.89377,-2.196672 -4.375,-3.28125 -1.48123,-1.084578 -2.99172,-2.168499 -4.5,-3.21875 -1.50828,-1.050251 -3.02779,-2.078416 -4.5625,-3.09375 -1.53471,-1.015334 -3.09571,-2.020174 -4.65625,-3 -3.12107,-1.959652 -6.27931,-3.842178 -9.5,-5.65625 -0.10562,-0.05949 -0.20678,-0.128169 -0.3125,-0.1875 -0.0198,-0.0056 -0.0426,0.0054 -0.0625,0 -0.51603,-0.139573 -1.06078,-0.217301 -1.59375,-0.1875 z m -277.40625,40 c -0.769532,-0.01083 -1.524909,0.167563 -2.21875,0.5 -0.802783,0.823737 -1.584823,1.664535 -2.375,2.5 -0.531672,0.562171 -1.067848,1.120053 -1.59375,1.6875 -2.417332,2.608296 -4.769839,5.282888 -7.0625,8 -1.177353,1.39532 -2.325177,2.7956 -3.46875,4.21875 -0.465857,0.57958 -0.946069,1.16588 -1.40625,1.75 -0.668152,0.84841 -1.343925,1.70461 -2,2.5625 -0.0405,0.0529 -0.08455,0.10327 -0.125,0.15625 -1.067256,1.39812 -2.090238,2.79592 -3.125,4.21875 -2.14835,2.95405 -4.245345,5.97417 -6.25,9.03125 -0.8151,1.24302 -1.615476,2.4905 -2.40625,3.75 -0.181639,0.28931 -0.350905,0.58483 -0.53125,0.875 -0.965485,1.55341 -1.91572,3.10981 -2.84375,4.6875 -0.06874,0.11686 -0.150215,0.22675 -0.21875,0.34375 -0.856778,1.4626 -1.675884,2.95461 -2.5,4.4375 -0.849274,1.52816 -1.685937,3.07579 -2.5,4.625 -0.07148,0.13602 -0.147547,0.27007 -0.21875,0.40625 -0.817564,1.56793 -1.624593,3.13329 -2.40625,4.71875 -0.0041,0.0125 -0.02721,0.0188 -0.03125,0.0312 l -2.0625,4.34375 -0.03125,0.0625 -0.09375,0.15625 -0.03125,0.0937 c -0.04326,0.0932 -0.08187,0.18802 -0.125,0.28125 -0.734998,1.58717 -1.458161,3.17369 -2.15625,4.78125 -0.01056,0.0208 -0.02098,0.0416 -0.03125,0.0625 -0.02616,0.0603 -0.03639,0.12718 -0.0625,0.1875 l -0.03125,0.0312 c -0.725851,1.67786 -1.408424,3.36422 -2.09375,5.0625 -0.690439,1.71095 -1.382553,3.4564 -2.03125,5.1875 -0.579355,1.54605 -1.141902,3.09458 -1.6875,4.65625 2.32e-4,0.0104 -2.96e-4,0.0209 0,0.0312 0.05523,1.93935 1.221204,3.87267 3.03125,4.625 l 17.46875,7.3125 c 2.428273,1.01841 5.56588,-0.28145 6.5625,-2.71875 l 3.625,-8.71875 0,-0.0312 1.5625,-3.75 c 0.04399,-0.0822 0.08567,-0.16552 0.125,-0.25 0.01072,-0.0311 0.02114,-0.0625 0.03125,-0.0937 l 0.03125,-0.0625 0.0625,-0.15625 1.84375,-4.0625 c 0.01072,-0.0311 0.02114,-0.0625 0.03125,-0.0937 l 0.03125,-0.0312 1.9375,-4.125 c 0.02118,-0.031 0.04202,-0.0624 0.0625,-0.0937 0.02141,-0.0414 0.04225,-0.083 0.0625,-0.125 l 2.125,-4.1875 0.03125,-0.0625 0.0625,-0.125 2.09375,-3.90625 0.0625,-0.0937 0.0625,-0.125 2.125,-3.75 0.0625,-0.0937 0.0625,-0.0937 c 0.02141,-0.0414 0.04225,-0.083 0.0625,-0.125 0.02118,-0.031 0.04202,-0.0624 0.0625,-0.0937 L 80.375,141.9065 80.5,141.719 c 3.2e-5,-0.0104 3.2e-5,-0.0208 0,-0.0312 0.02091,-0.0103 0.04174,-0.0206 0.0625,-0.0312 l 2.46875,-3.875 0.0625,-0.0625 0.0625,-0.125 2.5,-3.75 0.09375,-0.125 2.75,-3.875 c 0.02118,-0.031 0.04202,-0.0624 0.0625,-0.0937 l 0.03125,-0.0312 0.125,-0.1875 L 91.375,126 c 0.02118,-0.031 0.04202,-0.0623 0.0625,-0.0937 L 91.5,125.8438 c 0.01056,-0.0208 0.02098,-0.0416 0.03125,-0.0625 l 0.125,-0.1875 2.75,-3.46875 0.0625,-0.0625 L 97.375,118.5 c 0.01046,-0.0104 0.02088,-0.0208 0.03125,-0.0312 l 0,-0.0312 0.125,-0.125 2.8125,-3.25 0,-0.0312 6.1875,-7.125 c 1.72097,-1.97846 1.48254,-5.34624 -0.5,-7.0625 L 91.75,88.5 c -0.885681,-0.766338 -2.047618,-1.206295 -3.21875,-1.21875 z m 387.5,116.34375 c -0.1149,0.006 -0.22957,0.0171 -0.34375,0.0312 l -18.78125,2.1875 c -2.60237,0.30907 -4.68782,2.96058 -4.375,5.5625 l 1.125,9.375 0,0.0312 0.3125,2.71875 c -1.3e-4,0.0208 -1.3e-4,0.0417 0,0.0625 l 0.0312,0.25 0.0312,0 0.40625,4.8125 -0.0312,0 0.34375,4.8125 0,0.0937 c -2.9e-4,0.0312 -2.9e-4,0.0625 0,0.0937 l 0.1875,4.75 0,0.1875 0,0.0625 c -1.3e-4,0.0208 -1.3e-4,0.0417 0,0.0625 l 0.0625,4.9375 0,0.0625 0,0.0625 0,0.0625 0,0.0312 -0.0625,6.65625 c -3e-5,0.0104 -3e-5,0.0208 0,0.0312 l 0,0.0312 0,0.15625 -0.21875,6.46875 c -2.9e-4,0.0312 -2.9e-4,0.0625 0,0.0937 -1.3e-4,0.0208 -1.3e-4,0.0417 0,0.0625 l 0,0.21875 -0.375,6.25 0.0312,0 -0.5,6.34375 -0.0312,0 -0.0312,0.25 c -2.9e-4,0.0312 -2.9e-4,0.0625 0,0.0937 l -0.6875,6.28125 0,0.0625 -0.0312,0.15625 0,0.0312 -0.8125,6.125 -0.0312,0.15625 0,0.0312 c -1.3e-4,0.0208 -1.3e-4,0.0417 0,0.0625 l -0.375,2.4375 0,0.0312 c -0.0524,0.18489 -0.0942,0.37281 -0.125,0.5625 -0.0264,0.13448 -0.0472,0.27005 -0.0625,0.40625 l -1.5625,8.8125 c -0.46449,2.59481 1.49413,5.37574 4.09375,5.8125 l 18.625,3.25 c 2.22442,0.38405 4.5451,-1.01891 5.4375,-3.0625 0.40131,-1.87202 0.77054,-3.73883 1.125,-5.625 l 0.8125,-4.625 0.0312,-0.0937 c 1.3e-4,-0.0208 1.3e-4,-0.0417 0,-0.0625 0.0116,-0.0623 0.022,-0.12481 0.0312,-0.1875 l 0,-0.0937 c 0.0109,-0.0415 0.0213,-0.0832 0.0312,-0.125 l 0.5,-3.125 c 1.3e-4,-0.0208 1.3e-4,-0.0417 0,-0.0625 l 0.0312,-0.21875 c 3e-5,-0.0104 3e-5,-0.0208 0,-0.0312 l 0.9375,-6.78125 c 0.005,-0.0195 -0.005,-0.0429 0,-0.0625 0.002,-0.0131 0.023,-0.019 0.0312,-0.0312 0.001,-0.0102 -10e-4,-0.021 0,-0.0312 l 0,-0.0625 c 0.009,-0.0729 0.0224,-0.1458 0.0312,-0.21875 3e-5,-0.0104 3e-5,-0.0208 0,-0.0312 l 0,-0.0625 0.71875,-6.6875 0,-0.0937 0.0312,-0.15625 c 0.002,-0.0729 0.002,-0.14584 0,-0.21875 l 0.53125,-6.625 0,-0.0937 0.0312,-0.125 c 2.9e-4,-0.0312 2.9e-4,-0.0625 0,-0.0937 0.0248,-0.11381 0.0457,-0.22849 0.0625,-0.34375 l 0.375,-7 c 0.007,-0.0524 0.0263,-0.10366 0.0312,-0.15625 0.003,-0.0624 -0.003,-0.12508 0,-0.1875 l 0.125,-4.25 c 0.0184,-0.60574 0.0415,-1.20894 0.0625,-1.8125 0.008,-0.33455 0.024,-0.66524 0.0312,-1 6.5e-4,-0.0417 3.9e-4,-0.0833 0,-0.125 2.2e-4,-0.0104 -2.2e-4,-0.0209 0,-0.0312 l 0,-0.125 0,-0.0625 0.0312,-1.09375 c 0.0177,-1.00699 0.0224,-2.02253 0.0312,-3.03125 0.009,-0.97752 0.0308,-1.95846 0.0312,-2.9375 1.3e-4,-0.0208 1.3e-4,-0.0417 0,-0.0625 10e-6,-0.0312 0,-0.0625 0,-0.0937 0,-0.0417 2e-5,-0.0833 0,-0.125 2.9e-4,-0.0312 2.9e-4,-0.0625 0,-0.0937 l 0,-0.34375 0,-0.75 -0.0937,-4.28125 0,-0.0937 0,-0.15625 c 10e-4,-0.0625 10e-4,-0.12501 0,-0.1875 L 483.625,232.5 l 0,-0.1875 0,-0.0625 c 10e-4,-0.0417 -2.4e-4,-0.0833 0,-0.125 -0.003,-0.0622 0.003,-0.12529 0,-0.1875 -0.0978,-1.85367 -0.2318,-3.72092 -0.375,-5.5625 -0.002,-0.0101 0.002,-0.0213 0,-0.0312 -0.01,-0.0522 -0.0199,-0.10435 -0.0312,-0.15625 l 0,-0.0625 -0.0312,-0.21875 -0.4375,-5.09375 c -0.008,-0.094 -0.0181,-0.18782 -0.0312,-0.28125 l 0,-0.0625 -0.0312,-0.15625 -0.15625,-1.4375 c -0.0246,-0.21924 -0.0373,-0.4372 -0.0625,-0.65625 -0.0289,-0.25124 -0.0641,-0.49901 -0.0937,-0.75 3e-5,-0.0104 3e-5,-0.0208 0,-0.0312 l -0.3125,-2.46875 c -0.36198,-2.78171 -0.78554,-5.56334 -1.25,-8.3125 -0.84223,-1.81101 -2.76639,-3.13329 -4.78125,-3.03125 z m -428.3125,61.75 c -0.283227,0.007 -0.565832,0.0387 -0.84375,0.0937 l -18.5625,3.625 c -1.926766,0.38025 -3.472309,2.04273 -3.90625,3.9375 0.129956,0.9811 0.265247,1.95765 0.40625,2.9375 0.115304,0.78922 0.220126,1.58843 0.34375,2.375 0.276104,1.78848 0.583721,3.57552 0.90625,5.34375 0.0058,0.0319 0.02541,0.0618 0.03125,0.0937 l 0.09375,0.46875 0.9375,4.6875 0.03125,0.21875 c -3.2e-5,0.0104 -3.2e-5,0.0208 0,0.0312 0.01682,0.11526 0.03767,0.22994 0.0625,0.34375 0.178008,0.84548 0.374864,1.68924 0.5625,2.53125 0.126503,0.56246 0.245652,1.12773 0.375,1.6875 l 0.21875,0.9375 c 0.0098,0.0417 0.02141,0.0834 0.03125,0.125 0.01136,0.0519 0.01824,0.10476 0.03125,0.15625 l 0.0625,0.2189 c 0.06224,0.26135 0.124337,0.52025 0.1875,0.78125 0.233478,0.97089 0.470578,1.93858 0.71875,2.90625 l 0.3125,1.25 c 0.01092,0.0415 0.02031,0.0835 0.03125,0.125 0.0035,0.0202 -0.0038,0.0423 0,0.0625 l 0.0625,0.1875 0,0.0312 1.375,4.875 0.03125,0.125 c 0.01191,0.0411 0.01932,0.084 0.03125,0.125 0.01868,0.0839 0.03952,0.16722 0.0625,0.25 l 1.5,4.90625 0.03125,0.0937 c 0.007,0.022 0.02426,0.0405 0.03125,0.0625 l 0,0.0625 c 0.527756,1.65654 1.090836,3.29755 1.65625,4.9375 l 0.0625,0.21875 c 0.0075,0.0218 0.02371,0.0407 0.03125,0.0625 0.606316,1.75096 1.22633,3.51857 1.875,5.25 0.02612,0.0602 0.03403,0.12841 0.0625,0.1875 l 0.03125,0.0625 0.0625,0.15625 c 0.499713,1.32589 1.03674,2.62615 1.5625,3.9375 0.110996,0.27826 0.200411,0.56602 0.3125,0.84375 0.678653,1.67262 1.377635,3.34363 2.09375,5 -3.2e-5,0.0104 -3.2e-5,0.0208 0,0.0312 0.0054,0.0125 0.02583,0.0188 0.03125,0.0312 l 0.0625,0.1875 c 0.01027,0.0209 0.02069,0.0417 0.03125,0.0625 0.698046,1.60788 1.421525,3.19269 2.15625,4.78125 0.04312,0.0931 0.08177,0.18812 0.125,0.28125 0.01011,0.0313 0.02052,0.0627 0.03125,0.0937 l 0.125,0.21875 1.96875,4.15625 0.09375,0.1875 0,0.0312 c 0.0061,0.0124 0.02514,0.019 0.03125,0.0312 0.921133,1.86887 1.872102,3.72263 2.84375,5.5625 0.194334,0.36732 0.397386,0.72762 0.59375,1.09375 0.831294,1.54998 1.695493,3.06534 2.5625,4.59375 0.147324,0.25971 0.289163,0.52216 0.4375,0.78125 0.842975,1.47234 1.687414,2.95431 2.5625,4.40625 0.270024,0.44802 0.539481,0.89769 0.8125,1.34375 1.022944,1.67131 2.060981,3.32517 3.125,4.96875 0.01175,0.009 0.01942,0.0226 0.03125,0.0312 1.564829,1.14939 3.82504,1.40532 5.53125,0.4375 l 16.4375,-9.375 c 2.27277,-1.29425 3.165422,-4.53755 1.875,-6.8125 l -4.6875,-8.21875 c 3.2e-5,-0.0104 3.2e-5,-0.0208 0,-0.0312 l -1.625,-2.8125 -0.0625,-0.125 -2.1875,-4 c -0.02993,-0.0632 -0.06119,-0.12566 -0.09375,-0.1875 -0.02025,-0.042 -0.04109,-0.0836 -0.0625,-0.125 l -1.9375,-3.75 c -0.03815,-0.10553 -0.07984,-0.20978 -0.125,-0.3125 l -2.03125,-4.25 -0.09375,-0.1875 0,-0.0312 c -0.01011,-0.0313 -0.02053,-0.0627 -0.03125,-0.0937 l -1.84375,-4.0625 -0.03125,-0.0937 -0.03125,-0.0625 c -0.01027,-0.0209 -0.02069,-0.0417 -0.03125,-0.0625 -0.01011,-0.0313 -0.02053,-0.0627 -0.03125,-0.0937 l -0.125,-0.25 -1.6875,-4.09375 c -0.01037,-0.0104 -0.02079,-0.0208 -0.03125,-0.0312 L 65.3125,315.875 65.28125,315.78125 65.25,315.71875 63.625,311.5 c -0.01011,-0.0313 -0.02052,-0.0627 -0.03125,-0.0937 L 63.5625,311.34375 62,306.9375 c -0.02048,-0.0315 -0.04132,-0.0627 -0.0625,-0.0937 l -0.0625,-0.1875 -1.40625,-4.28125 c -0.02025,-0.042 -0.04109,-0.0836 -0.0625,-0.125 l 0,-0.0625 -0.09375,-0.25 -1.21875,-4 -0.03125,-0.0625 0,-0.0625 c -0.01011,-0.0314 -0.02052,-0.0625 -0.03125,-0.0937 C 59.02114,297.68735 59.01073,297.6561 59,297.625 l -0.03125,-0.1875 -0.03125,-0.0937 -1.1875,-4.3125 c 1.3e-4,-0.0208 1.3e-4,-0.0417 0,-0.0625 l -0.03125,-0.0625 -0.03125,-0.15625 -1.125,-4.5 c -0.01011,-0.0313 -0.02052,-0.0627 -0.03125,-0.0937 l 0,-0.0625 L 56.46875,287.875 55.5,283.5 c -0.01011,-0.0313 -0.02052,-0.0627 -0.03125,-0.0937 l 0,-0.0312 -0.0625,-0.25 -0.84375,-4.40625 c 3.2e-5,-0.0104 3.2e-5,-0.0208 0,-0.0312 l -1.8125,-9.2814 c -0.451941,-2.29126 -2.696573,-4.08976 -5.03125,-4.03125 z M 460.875,384.09375 c -0.27453,0.0295 -0.5466,0.0818 -0.8125,0.15625 l -18.34375,4.53125 c -2.53268,0.62806 -4.27083,3.49526 -3.65625,6.03125 l 2.25,9.1875 19.34375,78.25 c 0.0151,0.0764 0.0465,0.14281 0.0625,0.21875 0.92083,4.36043 3.35141,8.00776 6.53125,10.03125 0.4133,0.26301 0.81962,0.50569 1.25,0.71875 0.20282,0.10041 0.419,0.16043 0.625,0.25 l 0.34375,0.15625 a 14.555609,14.562046 0 0 0 2.78125,0.8125 14.555609,14.562046 0 0 0 1.4375,0.1875 14.555609,14.562046 0 0 0 0.75,0.0312 c 0.8858,0.0249 1.78415,-0.0327 2.65625,-0.15625 a 14.555609,14.562046 0 0 0 0.0625,0 c 0.29715,-0.0433 0.5835,-0.0956 0.875,-0.15625 A 14.555609,14.562046 0 0 0 478.375,494 c 0.0222,-0.007 0.0404,-0.0244 0.0625,-0.0312 a 14.555609,14.562046 0 0 0 1.25,-0.4375 c 0.0431,-0.0179 0.0821,-0.0442 0.125,-0.0625 a 14.555609,14.562046 0 0 0 2.53125,-1.4375 14.555609,14.562046 0 0 0 1.125,-0.90625 14.555609,14.562046 0 0 0 1.0625,-1 14.555609,14.562046 0 0 0 0.9375,-1.125 14.555609,14.562046 0 0 0 0.84375,-1.1875 14.555609,14.562046 0 0 0 0.6875,-1.28125 14.555609,14.562046 0 0 0 0.59375,-1.3125 14.555609,14.562046 0 0 0 0,-0.0312 14.555609,14.562046 0 0 0 0.4375,-1.34375 14.555609,14.562046 0 0 0 0,-0.0312 14.555609,14.562046 0 0 0 0.28125,-1.4375 14.555609,14.562046 0 0 0 0.125,-1.1875 c 0.005,-0.0818 0.0278,-0.16768 0.0312,-0.25 a 14.555609,14.562046 0 0 0 0,-0.1875 14.555609,14.562046 0 0 0 0,-1.0625 c -0.003,-0.0736 0.004,-0.14482 0,-0.21875 a 14.555609,14.562046 0 0 0 -0.0625,-0.8125 c -0.004,-0.0413 -0.0269,-0.0836 -0.0312,-0.125 -0.0375,-0.34634 -0.0969,-0.70742 -0.15625,-1.0625 a 14.555609,14.562046 0 0 0 0,-0.0937 14.555609,14.562046 0 0 0 -0.0625,-0.375 c -0.0271,-0.11565 -0.0584,-0.23033 -0.0937,-0.34375 l 0,-0.0312 -19.6875,-79.5625 c 3e-5,-0.0104 3e-5,-0.0208 0,-0.0312 l -2.28125,-9.15625 c -0.56292,-2.26546 -2.89065,-3.95202 -5.21875,-3.78125 z M 144.6875,411.0625 c -1.77853,0.003 -3.51899,1.03476 -4.375,2.59375 L 131.25,430.25 c -1.03117,1.88148 -0.55291,4.36851 0.90625,5.90625 1.41931,0.86022 2.84517,1.69759 4.28125,2.53125 0.69481,0.40103 1.39434,0.79343 2.09375,1.1875 1.57791,0.88905 3.14906,1.77174 4.75,2.625 0.0537,0.0286 0.10252,0.0652 0.15625,0.0937 0.13581,0.0723 0.27023,0.14674 0.40625,0.21875 3.11692,1.65016 6.29955,3.2384 9.5,4.75 0.0335,0.0159 0.0602,0.0467 0.0937,0.0625 1.64752,0.77717 3.29996,1.51036 4.96875,2.25 0.0426,0.0188 0.0824,0.0437 0.125,0.0625 3.36431,1.48873 6.77165,2.88592 10.21875,4.21875 0.0434,0.0167 0.0816,0.0458 0.125,0.0625 1.70275,0.6572 3.43419,1.28791 5.15625,1.90625 0.0436,0.0156 0.0814,0.0469 0.125,0.0625 1.66049,0.59512 3.32209,1.16026 5,1.71875 0.0627,0.0209 0.12476,0.0417 0.1875,0.0625 0.0218,0.008 0.0406,0.0238 0.0625,0.0312 0.0501,0.0166 0.10613,0.0147 0.15625,0.0312 0.0219,0.007 0.0406,0.024 0.0625,0.0312 l 4.90625,1.5625 c 0.01,0.003 0.0217,-0.003 0.0312,0 0.0214,0.009 0.042,0.0199 0.0625,0.0312 0.0205,0.0113 0.0408,0.023 0.0625,0.0312 0.0721,0.022 0.14665,0.0406 0.21875,0.0625 l 0,-0.0312 3.21875,0.96875 1.59375,0.46875 0.25,0.0625 c 0.62479,0.17474 1.24808,0.33032 1.875,0.5 1.21457,0.32739 2.42565,0.65719 3.65625,0.96875 0.0518,0.0131 0.10447,0.0183 0.15625,0.0312 l 0.125,0.0312 c 0.0208,0.0106 0.0416,0.0211 0.0625,0.0312 l 5.1875,1.25 c 0.0615,0.014 0.12594,0.0174 0.1875,0.0312 0.0517,0.005 0.10445,-0.003 0.15625,0 0.0311,0.0107 0.0625,0.0211 0.0937,0.0312 l 0.21875,0.0312 4.625,1 0.21875,0.0625 c 0.14628,0.0296 0.29112,0.0645 0.4375,0.0937 l 5.28125,1 c 0.0725,0.0128 0.14623,0.0186 0.21875,0.0312 0.0321,0.006 0.0616,0.026 0.0937,0.0312 l 0.25,0.0312 c 0.0303,0.005 0.0634,-0.005 0.0937,0 l 0.25,0.0312 5,0.84375 c 0.17567,0.0263 0.35545,0.0365 0.53125,0.0625 1.53408,0.22655 3.08135,0.42832 4.625,0.625 2.21529,-0.18371 4.29241,-1.93576 4.65625,-4.15625 L 231,445.09375 c 0.4261,-2.59439 -1.55913,-5.34087 -4.15625,-5.75 L 217.6875,437.875 c -0.0519,-0.0112 -0.10401,-0.0217 -0.15625,-0.0312 -0.0104,-3e-5 -0.0208,-3e-5 -0.0312,0 -0.10347,-0.0241 -0.2077,-0.045 -0.3125,-0.0625 -0.0208,-1.3e-4 -0.0417,-1.3e-4 -0.0625,0 -0.0312,-2.9e-4 -0.0625,-2.9e-4 -0.0937,0 l -4.40625,-0.875 -0.0625,0 -4.5625,-0.9375 -0.0625,-0.0312 c -0.0621,-0.0221 -0.12456,-0.0429 -0.1875,-0.0625 l -4.78125,-1.125 -0.21875,-0.0625 c -0.0415,-0.0109 -0.0832,-0.0213 -0.125,-0.0312 l -4.28125,-1.09375 c -0.14384,-0.0483 -0.28987,-0.09 -0.4375,-0.125 -0.15411,-0.0492 -0.3106,-0.0909 -0.46875,-0.125 l -0.0312,0 -4.21875,-1.25 c -0.0103,-0.0104 -0.0207,-0.0208 -0.0312,-0.0312 l -0.094,-0.0315 -0.125,-0.0312 -4.5,-1.4375 c -0.0208,-1.3e-4 -0.0417,-1.3e-4 -0.0625,0 l -0.0625,-0.0312 -0.21875,-0.0625 -4.28125,-1.5 c -0.0208,-0.0105 -0.0416,-0.0211 -0.0625,-0.0312 l -0.0312,0 -0.15625,-0.0625 -4.28125,-1.59375 -0.0937,-0.0312 -4.4375,-1.75 -0.125,-0.0625 -0.0937,-0.0312 -4.15625,-1.75 -0.1875,-0.0937 c -0.0208,-0.0105 -0.0416,-0.0211 -0.0625,-0.0312 -0.0311,-0.0107 -0.0625,-0.0211 -0.0937,-0.0312 l -0.0937,-0.0625 c -0.0928,-0.034 -0.1866,-0.0654 -0.28125,-0.0937 l -3.8125,-1.78125 -0.15625,-0.0625 -0.0312,-0.0312 c -0.0208,-0.0105 -0.0416,-0.0211 -0.0625,-0.0312 l -4.28125,-2.09375 c -0.0311,-0.0107 -0.0625,-0.0211 -0.0937,-0.0312 l -0.125,-0.0625 -0.2191,-0.0944 -3.875,-2.03125 c -0.0208,-0.0106 -0.0416,-0.0211 -0.0625,-0.0312 l -0.0625,-0.0312 -0.125,-0.0625 -1.34375,-0.71875 -0.0312,-0.0312 -8.28125,-4.53125 c -0.7328,-0.40543 -1.56877,-0.62257 -2.40625,-0.625 z m 213.1875,9.125 -1.3125,0.0312 c -0.0833,-0.002 -0.16668,-0.002 -0.25,0 l -0.84375,0.0625 c -0.0731,0.009 -0.14607,0.0192 -0.21875,0.0312 l -1.3125,0.15625 c -0.094,0.008 -0.18782,0.0181 -0.28125,0.0312 l -0.875,0.15625 c -0.0313,0.0101 -0.0627,0.0206 -0.0937,0.0312 l -1.28125,0.25 c -0.0943,0.0182 -0.18811,0.0389 -0.28125,0.0625 l -0.84375,0.21875 c -0.0838,0.0187 -0.16722,0.0395 -0.25,0.0625 l -1.2813,0.40645 c -0.0313,0.0101 -0.0627,0.0206 -0.0937,0.0312 l -0.375,0.125 c -0.0315,0.0205 -0.0627,0.0413 -0.0937,0.0625 l -6.125,2.21875 0,-0.0312 -0.0937,0.0312 c -3e-5,0.0104 -3e-5,0.0208 0,0.0312 -0.0104,-3e-5 -0.0208,-3e-5 -0.0312,0 l -5.59375,1.9375 -0.125,0.0312 -0.0312,0 c -0.11565,0.0271 -0.23033,0.0584 -0.34375,0.0937 l -5.40625,1.8125 c -0.12615,0.0264 -0.25127,0.0577 -0.375,0.0937 l -2.6875,0.84375 -9.03125,2.84375 c -2.50655,0.78057 -4.07238,3.77801 -3.28125,6.28125 l 5.65625,18.03125 c 0.67033,2.15279 2.96415,3.60094 5.1875,3.46875 0.11376,-0.0321 0.22997,-0.0616 0.34375,-0.0937 0.24064,-0.0682 0.47809,-0.15 0.71875,-0.21875 3.90291,-1.11489 7.81948,-2.26842 11.75,-3.53125 0.0305,-0.0122 0.0636,-0.0184 0.0937,-0.0312 0.0428,-0.0181 0.0827,-0.0432 0.125,-0.0625 l 0.125,-0.0312 0.15625,-0.0625 5.5,-1.84375 0.125,-0.0312 c 0.0734,-0.0192 0.14632,-0.04 0.21875,-0.0625 0.0734,-0.0192 0.14632,-0.04 0.21875,-0.0625 l 6.125,-2.125 0.0625,-0.0312 0.0312,0 c 0.0313,-0.0101 0.0627,-0.0206 0.0937,-0.0312 l 5.875,-2.09375 0.0937,-0.0312 c 0.0625,-0.0227 0.12501,-0.0398 0.1875,-0.0625 l 0.0937,-0.0312 c 0.0209,-0.0103 0.0417,-0.0208 0.0625,-0.0312 0.0313,-0.0114 0.0625,-0.0199 0.0937,-0.0312 l 0,0.0312 0.0312,0 0.0937,0.0312 0.15625,0.0625 0.0937,0.0312 0.0625,0.0312 33.75,13.59375 0.28125,0.125 8.46875,3.40625 c 0.0212,0.009 0.0412,0.0231 0.0625,0.0312 0.0513,0.0197 0.10444,0.0448 0.15625,0.0625 2.38644,0.81594 5.32465,-0.49745 6.28125,-2.84375 l 7.0625,-17.5625 c 0.97644,-2.42227 -0.3316,-5.514 -2.75,-6.5 L 403,436.0625 368.8125,422.28125 c -0.0311,-0.0107 -0.0625,-0.0211 -0.0937,-0.0312 l -0.40625,-0.15625 c -0.0414,-0.0214 -0.083,-0.0422 -0.125,-0.0625 l -1.25,-0.4375 c -0.0828,-0.023 -0.16615,-0.0438 -0.25,-0.0625 l -0.84375,-0.25 c -0.0724,-0.0225 -0.14537,-0.0433 -0.21875,-0.0625 l -1.28125,-0.3125 c -0.0931,-0.0235 -0.18693,-0.0444 -0.28125,-0.0625 l -0.84375,-0.15625 c -0.0311,-0.0107 -0.0625,-0.0211 -0.0937,-0.0312 l -1.3125,-0.21875 c -0.083,-0.0125 -0.16642,-0.0229 -0.25,-0.0312 l -0.84375,-0.0937 c -0.10381,-0.0137 -0.20804,-0.0242 -0.3125,-0.0312 l -1.3125,-0.0625 c -0.0208,-1.3e-4 -0.0417,-1.3e-4 -0.0625,0 l -0.84375,-0.0312 c -0.10413,-0.003 -0.20837,-0.003 -0.3125,0 z" + id="path4832" + inkscape:connector-curvature="0" /> + inkscape:label="Dots" + style="display:inline"> Date: Mon, 11 Jan 2016 11:17:45 +0100 Subject: ask to be excluded from battery optimization --- src/main/AndroidManifest.xml | 1 + .../conversations/ui/ConversationActivity.java | 123 ++++--- .../conversations/ui/EditAccountActivity.java | 27 +- .../eu/siacs/conversations/ui/XmppActivity.java | 11 + .../siacs/conversations/utils/ExceptionHelper.java | 56 +-- src/main/res/layout/activity_edit_account.xml | 381 ++++++++++++--------- src/main/res/values/strings.xml | 4 + 7 files changed, 361 insertions(+), 242 deletions(-) diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml index 2f93480e3..dda0fbe94 100644 --- a/src/main/AndroidManifest.xml +++ b/src/main/AndroidManifest.xml @@ -14,6 +14,7 @@ + arg0, View clickedView, - int position, long arg3) { + int position, long arg3) { if (getSelectedConversation() != conversationList.get(position)) { setSelectedConversation(conversationList.get(position)); ConversationActivity.this.mConversationFragment.reInit(getSelectedConversation()); @@ -288,7 +290,7 @@ public class ConversationActivity extends XmppActivity SlidingPaneLayout mSlidingPaneLayout = (SlidingPaneLayout) mContentView; mSlidingPaneLayout.setParallaxDistance(150); mSlidingPaneLayout - .setShadowResource(R.drawable.es_slidingpane_shadow); + .setShadowResource(R.drawable.es_slidingpane_shadow); mSlidingPaneLayout.setSliderFadeColor(0); mSlidingPaneLayout.setPanelSlideListener(new PanelSlideListener() { @@ -299,7 +301,7 @@ public class ConversationActivity extends XmppActivity hideKeyboard(); if (xmppConnectionServiceBound) { xmppConnectionService.getNotificationService() - .setOpenConversation(null); + .setOpenConversation(null); } closeContextMenu(); } @@ -442,7 +444,7 @@ public class ConversationActivity extends XmppActivity case ATTACHMENT_CHOICE_CHOOSE_IMAGE: intent.setAction(Intent.ACTION_GET_CONTENT); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) { - intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE,true); + intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true); } intent.setType("image/*"); chooser = true; @@ -509,16 +511,16 @@ public class ConversationActivity extends XmppActivity } switch (attachmentChoice) { case ATTACHMENT_CHOICE_LOCATION: - getPreferences().edit().putString("recently_used_quick_action","location").apply(); + getPreferences().edit().putString("recently_used_quick_action", "location").apply(); break; case ATTACHMENT_CHOICE_RECORD_VOICE: - getPreferences().edit().putString("recently_used_quick_action","voice").apply(); + getPreferences().edit().putString("recently_used_quick_action", "voice").apply(); break; case ATTACHMENT_CHOICE_TAKE_PHOTO: - getPreferences().edit().putString("recently_used_quick_action","photo").apply(); + getPreferences().edit().putString("recently_used_quick_action", "photo").apply(); break; case ATTACHMENT_CHOICE_CHOOSE_IMAGE: - getPreferences().edit().putString("recently_used_quick_action","picture").apply(); + getPreferences().edit().putString("recently_used_quick_action", "picture").apply(); break; } final Conversation conversation = getSelectedConversation(); @@ -558,19 +560,19 @@ public class ConversationActivity extends XmppActivity selectPresenceToAttachFile(attachmentChoice, encryption); } else { final ConversationFragment fragment = (ConversationFragment) getFragmentManager() - .findFragmentByTag("conversation"); + .findFragmentByTag("conversation"); if (fragment != null) { fragment.showNoPGPKeyDialog(false, new OnClickListener() { @Override public void onClick(DialogInterface dialog, - int which) { + int which) { conversation - .setNextEncryption(Message.ENCRYPTION_NONE); + .setNextEncryption(Message.ENCRYPTION_NONE); xmppConnectionService.databaseBackend - .updateConversation(conversation); - selectPresenceToAttachFile(attachmentChoice,Message.ENCRYPTION_NONE); + .updateConversation(conversation); + selectPresenceToAttachFile(attachmentChoice, Message.ENCRYPTION_NONE); } }); } @@ -610,8 +612,8 @@ public class ConversationActivity extends XmppActivity attachFile(requestCode); } } else { - Toast.makeText(this,R.string.no_storage_permission,Toast.LENGTH_SHORT).show(); - } + Toast.makeText(this, R.string.no_storage_permission, Toast.LENGTH_SHORT).show(); + } } public void startDownloadable(Message message) { @@ -622,14 +624,14 @@ public class ConversationActivity extends XmppActivity Transferable transferable = message.getTransferable(); if (transferable != null) { if (!transferable.start()) { - Toast.makeText(this, R.string.not_connected_try_again,Toast.LENGTH_SHORT).show(); + Toast.makeText(this, R.string.not_connected_try_again, Toast.LENGTH_SHORT).show(); } } else if (message.treatAsDownloadable() != Message.Decision.NEVER) { xmppConnectionService.getHttpConnectionManager().createNewDownloadConnection(message, true); } } - @Override + @Override public boolean onOptionsItemSelected(final MenuItem item) { if (item.getItemId() == android.R.id.home) { showConversationsOverview(); @@ -700,9 +702,9 @@ public class ConversationActivity extends XmppActivity this.mConversationFragment.reInit(getSelectedConversation()); } else { setSelectedConversation(null); - if (mRedirected.compareAndSet(false,true)) { + if (mRedirected.compareAndSet(false, true)) { Intent intent = new Intent(this, StartConversationActivity.class); - intent.putExtra("init",true); + intent.putExtra("init", true); startActivity(intent); finish(); } @@ -717,7 +719,7 @@ public class ConversationActivity extends XmppActivity View dialogView = getLayoutInflater().inflate( R.layout.dialog_clear_history, null); final CheckBox endConversationCheckBox = (CheckBox) dialogView - .findViewById(R.id.end_conversation_checkbox); + .findViewById(R.id.end_conversation_checkbox); builder.setView(dialogView); builder.setNegativeButton(getString(R.string.cancel), null); builder.setPositiveButton(getString(R.string.delete_messages), @@ -819,7 +821,7 @@ public class ConversationActivity extends XmppActivity } PopupMenu popup = new PopupMenu(this, menuItemView); final ConversationFragment fragment = (ConversationFragment) getFragmentManager() - .findFragmentByTag("conversation"); + .findFragmentByTag("conversation"); if (fragment != null) { popup.setOnMenuItemClickListener(new OnMenuItemClickListener() { @@ -840,7 +842,7 @@ public class ConversationActivity extends XmppActivity conversation.setNextEncryption(Message.ENCRYPTION_PGP); item.setChecked(true); } else { - announcePgp(conversation.getAccount(),conversation); + announcePgp(conversation.getAccount(), conversation); } } else { showInstallPgpDialog(); @@ -946,7 +948,7 @@ public class ConversationActivity extends XmppActivity int rotation = getWindowManager().getDefaultDisplay().getRotation(); final int upKey; final int downKey; - switch(rotation) { + switch (rotation) { case Surface.ROTATION_90: upKey = KeyEvent.KEYCODE_DPAD_LEFT; downKey = KeyEvent.KEYCODE_DPAD_RIGHT; @@ -969,7 +971,8 @@ public class ConversationActivity extends XmppActivity return true; } else if (modifier && key == downKey) { if (isConversationsOverviewHideable() && !isConversationsOverviewVisable()) { - showConversationsOverview();; + showConversationsOverview(); + ; } return selectDownConversation(); } else if (modifier && key == upKey) { @@ -1105,11 +1108,11 @@ public class ConversationActivity extends XmppActivity public void onSaveInstanceState(final Bundle savedInstanceState) { Conversation conversation = getSelectedConversation(); if (conversation != null) { - savedInstanceState.putString(STATE_OPEN_CONVERSATION,conversation.getUuid()); + savedInstanceState.putString(STATE_OPEN_CONVERSATION, conversation.getUuid()); } else { savedInstanceState.remove(STATE_OPEN_CONVERSATION); } - savedInstanceState.putBoolean(STATE_PANEL_OPEN,isConversationsOverviewVisable()); + savedInstanceState.putBoolean(STATE_PANEL_OPEN, isConversationsOverviewVisable()); if (this.mPendingImageUris.size() >= 1) { savedInstanceState.putString(STATE_PENDING_URI, this.mPendingImageUris.get(0).toString()); } else { @@ -1136,7 +1139,7 @@ public class ConversationActivity extends XmppActivity } if (xmppConnectionService.getAccounts().size() == 0) { - if (mRedirected.compareAndSet(false,true)) { + if (mRedirected.compareAndSet(false, true)) { if (Config.X509_VERIFICATION) { startActivity(new Intent(this, ManageAccountActivity.class)); } else { @@ -1145,9 +1148,9 @@ public class ConversationActivity extends XmppActivity finish(); } } else if (conversationList.size() <= 0) { - if (mRedirected.compareAndSet(false,true)) { + if (mRedirected.compareAndSet(false, true)) { Intent intent = new Intent(this, StartConversationActivity.class); - intent.putExtra("init",true); + intent.putExtra("init", true); startActivity(intent); finish(); } @@ -1179,7 +1182,7 @@ public class ConversationActivity extends XmppActivity this.onActivityResult(mPostponedActivityResult.first, RESULT_OK, mPostponedActivityResult.second); } - if(!forbidProcessingPendings) { + if (!forbidProcessingPendings) { for (Iterator i = mPendingImageUris.iterator(); i.hasNext(); i.remove()) { Uri foo = i.next(); attachImageToConversation(getSelectedConversation(), foo); @@ -1196,7 +1199,9 @@ public class ConversationActivity extends XmppActivity } forbidProcessingPendings = false; - ExceptionHelper.checkForCrash(this, this.xmppConnectionService); + if (!ExceptionHelper.checkForCrash(this, this.xmppConnectionService)) { + openBatteryOptimizationDialogIfNeeded(); + } setIntent(new Intent()); } @@ -1205,14 +1210,14 @@ public class ConversationActivity extends XmppActivity final String downloadUuid = intent.getStringExtra(MESSAGE); final String text = intent.getStringExtra(TEXT); final String nick = intent.getStringExtra(NICK); - final boolean pm = intent.getBooleanExtra(PRIVATE_MESSAGE,false); + final boolean pm = intent.getBooleanExtra(PRIVATE_MESSAGE, false); if (selectConversationByUuid(uuid)) { this.mConversationFragment.reInit(getSelectedConversation()); if (nick != null) { if (pm) { Jid jid = getSelectedConversation().getJid(); try { - Jid next = Jid.fromParts(jid.getLocalpart(),jid.getDomainpart(),nick); + Jid next = Jid.fromParts(jid.getLocalpart(), jid.getDomainpart(), nick); this.mConversationFragment.privateMessageWith(next); } catch (final InvalidJidException ignored) { //do nothing @@ -1262,7 +1267,7 @@ public class ConversationActivity extends XmppActivity Uri uri = intent.getData(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2 && uri == null) { ClipData clipData = intent.getClipData(); - for(int i = 0; i < clipData.getItemCount(); ++i) { + for (int i = 0; i < clipData.getItemCount(); ++i) { uris.add(clipData.getItemAt(i).getUri()); } } else { @@ -1272,8 +1277,7 @@ public class ConversationActivity extends XmppActivity } @Override - protected void onActivityResult(int requestCode, int resultCode, - final Intent data) { + protected void onActivityResult(int requestCode, int resultCode, final Intent data) { super.onActivityResult(requestCode, resultCode, data); if (resultCode == RESULT_OK) { if (requestCode == REQUEST_DECRYPT_PGP) { @@ -1301,15 +1305,15 @@ public class ConversationActivity extends XmppActivity mPendingImageUris.clear(); mPendingImageUris.addAll(extractUriFromIntent(data)); if (xmppConnectionServiceBound) { - for(Iterator i = mPendingImageUris.iterator(); i.hasNext(); i.remove()) { - attachImageToConversation(getSelectedConversation(),i.next()); + for (Iterator i = mPendingImageUris.iterator(); i.hasNext(); i.remove()) { + attachImageToConversation(getSelectedConversation(), i.next()); } } } else if (requestCode == ATTACHMENT_CHOICE_CHOOSE_FILE || requestCode == ATTACHMENT_CHOICE_RECORD_VOICE) { mPendingFileUris.clear(); mPendingFileUris.addAll(extractUriFromIntent(data)); if (xmppConnectionServiceBound) { - for(Iterator i = mPendingFileUris.iterator(); i.hasNext(); i.remove()) { + for (Iterator i = mPendingFileUris.iterator(); i.hasNext(); i.remove()) { attachFileToConversation(getSelectedConversation(), i.next()); } } @@ -1327,9 +1331,9 @@ public class ConversationActivity extends XmppActivity mPendingImageUris.clear(); } } else if (requestCode == ATTACHMENT_CHOICE_LOCATION) { - double latitude = data.getDoubleExtra("latitude",0); - double longitude = data.getDoubleExtra("longitude",0); - this.mPendingGeoUri = Uri.parse("geo:"+String.valueOf(latitude)+","+String.valueOf(longitude)); + double latitude = data.getDoubleExtra("latitude", 0); + double longitude = data.getDoubleExtra("longitude", 0); + this.mPendingGeoUri = Uri.parse("geo:" + String.valueOf(latitude) + "," + String.valueOf(longitude)); if (xmppConnectionServiceBound) { attachLocationToConversation(getSelectedConversation(), mPendingGeoUri); this.mPendingGeoUri = null; @@ -1344,6 +1348,39 @@ public class ConversationActivity extends XmppActivity if (requestCode == ConversationActivity.REQUEST_DECRYPT_PGP) { mConversationFragment.onActivityResult(requestCode, resultCode, data); } + if (requestCode == REQUEST_BATTERY_OP) { + setNeverAskForBatteryOptimizationsAgain(); + } + } + } + + private void setNeverAskForBatteryOptimizationsAgain() { + getPreferences().edit().putBoolean("show_battery_optimization", false).commit(); + } + + private void openBatteryOptimizationDialogIfNeeded() { + if (showBatteryOptimizationWarning() && getPreferences().getBoolean("show_battery_optimization", true)) { + AlertDialog.Builder builder = new AlertDialog.Builder(this); + builder.setTitle(R.string.battery_optimizations_enabled); + builder.setMessage(R.string.battery_optimizations_enabled_dialog); + builder.setPositiveButton(R.string.next, new OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + Intent intent = new Intent(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS); + Uri uri = Uri.parse("package:" + getPackageName()); + intent.setData(uri); + startActivityForResult(intent, REQUEST_BATTERY_OP); + } + }); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) { + builder.setOnDismissListener(new DialogInterface.OnDismissListener() { + @Override + public void onDismiss(DialogInterface dialog) { + setNeverAskForBatteryOptimizationsAgain(); + } + }); + } + builder.create().show(); } } diff --git a/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java b/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java index 01054de1e..09958c22b 100644 --- a/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java @@ -5,9 +5,10 @@ import android.app.AlertDialog.Builder; import android.app.PendingIntent; import android.content.DialogInterface; import android.content.Intent; -import android.content.res.Configuration; import android.graphics.Bitmap; +import android.net.Uri; import android.os.Bundle; +import android.provider.Settings; import android.security.KeyChain; import android.security.KeyChainAliasCallback; import android.text.Editable; @@ -52,16 +53,17 @@ import eu.siacs.conversations.xmpp.pep.Avatar; public class EditAccountActivity extends XmppActivity implements OnAccountUpdate, OnKeyStatusUpdated, OnCaptchaRequested, KeyChainAliasCallback, XmppConnectionService.OnShowErrorToast { - private LinearLayout mMainLayout; private AutoCompleteTextView mAccountJid; private EditText mPassword; private EditText mPasswordConfirm; private CheckBox mRegisterNew; private Button mCancelButton; private Button mSaveButton; + private Button mDisableBatterOptimizations; private TableLayout mMoreTable; private LinearLayout mStats; + private RelativeLayout mBatteryOptimizations; private TextView mServerInfoSm; private TextView mServerInfoRosterVersion; private TextView mServerInfoCarbons; @@ -311,6 +313,14 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate }); } + @Override + protected void onActivityResult(int requestCode, int resultCode, Intent data) { + super.onActivityResult(requestCode, resultCode, data); + if (requestCode == REQUEST_BATTERY_OP) { + updateAccountInformation(mAccount == null); + } + } + protected void updateSaveButton() { if (accountInfoEdited() && !mInitMode) { this.mSaveButton.setText(R.string.save); @@ -372,7 +382,6 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate protected void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_edit_account); - this.mMainLayout = (LinearLayout) findViewById(R.id.account_main_layout); this.mAccountJid = (AutoCompleteTextView) findViewById(R.id.account_jid); this.mAccountJid.addTextChangedListener(this.mTextWatcher); this.mAccountJidLabel = (TextView) findViewById(R.id.account_jid_label); @@ -387,6 +396,17 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate this.mAvatar.setOnClickListener(this.mAvatarClickListener); this.mRegisterNew = (CheckBox) findViewById(R.id.account_register_new); this.mStats = (LinearLayout) findViewById(R.id.stats); + this.mBatteryOptimizations = (RelativeLayout) findViewById(R.id.battery_optimization); + this.mDisableBatterOptimizations = (Button) findViewById(R.id.batt_op_disable); + this.mDisableBatterOptimizations.setOnClickListener(new OnClickListener() { + @Override + public void onClick(View v) { + Intent intent = new Intent(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS); + Uri uri = Uri.parse("package:"+getPackageName()); + intent.setData(uri); + startActivityForResult(intent,REQUEST_BATTERY_OP); + } + }); this.mSessionEst = (TextView) findViewById(R.id.session_est); this.mServerInfoRosterVersion = (TextView) findViewById(R.id.server_info_roster_version); this.mServerInfoCarbons = (TextView) findViewById(R.id.server_info_carbons); @@ -595,6 +615,7 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate } if (this.mAccount.isOnlineAndConnected() && !this.mFetchingAvatar) { this.mStats.setVisibility(View.VISIBLE); + this.mBatteryOptimizations.setVisibility(showBatteryOptimizationWarning() ? View.VISIBLE : View.GONE); this.mSessionEst.setText(UIHelper.readableTimeDifferenceFull(this, this.mAccount.getXmppConnection() .getLastSessionEstablished())); Features features = this.mAccount.getXmppConnection().getFeatures(); diff --git a/src/main/java/eu/siacs/conversations/ui/XmppActivity.java b/src/main/java/eu/siacs/conversations/ui/XmppActivity.java index a23f51ebd..36e82b2a7 100644 --- a/src/main/java/eu/siacs/conversations/ui/XmppActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/XmppActivity.java @@ -35,6 +35,7 @@ import android.os.Build; import android.os.Bundle; import android.os.Handler; import android.os.IBinder; +import android.os.PowerManager; import android.os.SystemClock; import android.preference.PreferenceManager; import android.text.InputType; @@ -91,6 +92,7 @@ public abstract class XmppActivity extends Activity { protected static final int REQUEST_ANNOUNCE_PGP = 0x0101; protected static final int REQUEST_INVITE_TO_CONVERSATION = 0x0102; protected static final int REQUEST_CHOOSE_PGP_ID = 0x0103; + protected static final int REQUEST_BATTERY_OP = 0x13849ff; public XmppConnectionService xmppConnectionService; public boolean xmppConnectionServiceBound = false; @@ -372,6 +374,15 @@ public abstract class XmppActivity extends Activity { } } + protected boolean showBatteryOptimizationWarning() { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + PowerManager pm = (PowerManager) getSystemService(POWER_SERVICE); + return !pm.isIgnoringBatteryOptimizations(getPackageName()); + } else { + return false; + } + } + protected boolean usingEnterKey() { return getPreferences().getBoolean("display_enter_key", false); } diff --git a/src/main/java/eu/siacs/conversations/utils/ExceptionHelper.java b/src/main/java/eu/siacs/conversations/utils/ExceptionHelper.java index 0f1828473..8799b4a55 100644 --- a/src/main/java/eu/siacs/conversations/utils/ExceptionHelper.java +++ b/src/main/java/eu/siacs/conversations/utils/ExceptionHelper.java @@ -24,6 +24,7 @@ import eu.siacs.conversations.entities.Account; import eu.siacs.conversations.entities.Conversation; import eu.siacs.conversations.entities.Message; import eu.siacs.conversations.services.XmppConnectionService; +import eu.siacs.conversations.ui.ConversationActivity; import eu.siacs.conversations.xmpp.jid.InvalidJidException; import eu.siacs.conversations.xmpp.jid.Jid; @@ -35,14 +36,13 @@ public class ExceptionHelper { } } - public static void checkForCrash(Context context, - final XmppConnectionService service) { + public static boolean checkForCrash(ConversationActivity activity, final XmppConnectionService service) { try { final SharedPreferences preferences = PreferenceManager - .getDefaultSharedPreferences(context); + .getDefaultSharedPreferences(activity); boolean neverSend = preferences.getBoolean("never_send", false); if (neverSend) { - return; + return false; } List accounts = service.getAccounts(); Account account = null; @@ -53,24 +53,25 @@ public class ExceptionHelper { } } if (account == null) { - return; + return false; } final Account finalAccount = account; - FileInputStream file = context.openFileInput("stacktrace.txt"); + FileInputStream file = activity.openFileInput("stacktrace.txt"); InputStreamReader inputStreamReader = new InputStreamReader(file); BufferedReader stacktrace = new BufferedReader(inputStreamReader); final StringBuilder report = new StringBuilder(); - PackageManager pm = context.getPackageManager(); + PackageManager pm = activity.getPackageManager(); PackageInfo packageInfo = null; try { - packageInfo = pm.getPackageInfo(context.getPackageName(), 0); + packageInfo = pm.getPackageInfo(activity.getPackageName(), 0); report.append("Version: " + packageInfo.versionName + '\n'); report.append("Last Update: " - + DateUtils.formatDateTime(context, - packageInfo.lastUpdateTime, - DateUtils.FORMAT_SHOW_TIME - | DateUtils.FORMAT_SHOW_DATE) + '\n'); + + DateUtils.formatDateTime(activity, + packageInfo.lastUpdateTime, + DateUtils.FORMAT_SHOW_TIME + | DateUtils.FORMAT_SHOW_DATE) + '\n'); } catch (NameNotFoundException e) { + return false; } String line; while ((line = stacktrace.readLine()) != null) { @@ -78,11 +79,11 @@ public class ExceptionHelper { report.append('\n'); } file.close(); - context.deleteFile("stacktrace.txt"); - AlertDialog.Builder builder = new AlertDialog.Builder(context); - builder.setTitle(context.getString(R.string.crash_report_title)); - builder.setMessage(context.getText(R.string.crash_report_message)); - builder.setPositiveButton(context.getText(R.string.send_now), + activity.deleteFile("stacktrace.txt"); + AlertDialog.Builder builder = new AlertDialog.Builder(activity); + builder.setTitle(activity.getString(R.string.crash_report_title)); + builder.setMessage(activity.getText(R.string.crash_report_message)); + builder.setPositiveButton(activity.getText(R.string.send_now), new OnClickListener() { @Override @@ -91,18 +92,18 @@ public class ExceptionHelper { Log.d(Config.LOGTAG, "using account=" + finalAccount.getJid().toBareJid() + " to send in stack trace"); - Conversation conversation = null; - try { - conversation = service.findOrCreateConversation(finalAccount, - Jid.fromString("bugs@siacs.eu"), false); - } catch (final InvalidJidException ignored) { - } - Message message = new Message(conversation, report + Conversation conversation = null; + try { + conversation = service.findOrCreateConversation(finalAccount, + Jid.fromString("bugs@siacs.eu"), false); + } catch (final InvalidJidException ignored) { + } + Message message = new Message(conversation, report .toString(), Message.ENCRYPTION_NONE); service.sendMessage(message); } }); - builder.setNegativeButton(context.getText(R.string.send_never), + builder.setNegativeButton(activity.getText(R.string.send_never), new OnClickListener() { @Override @@ -112,8 +113,9 @@ public class ExceptionHelper { } }); builder.create().show(); + return true; } catch (final IOException ignored) { - } - + return false; + } } } diff --git a/src/main/res/layout/activity_edit_account.xml b/src/main/res/layout/activity_edit_account.xml index 73395bba9..ed9358192 100644 --- a/src/main/res/layout/activity_edit_account.xml +++ b/src/main/res/layout/activity_edit_account.xml @@ -1,7 +1,7 @@ @@ -10,22 +10,22 @@ android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_above="@+id/button_bar" - android:layout_alignParentTop="true" > + android:layout_alignParentTop="true"> + android:orientation="vertical"> @@ -40,78 +40,78 @@ - + android:layout_toRightOf="@+id/avater" + android:orientation="vertical"> + - + - + - + + android:layout_weight="0.8" + android:orientation="vertical"> + android:textSize="?attr/TextSizeBody"/> + android:textSize="?attr/TextSizeBody"/> + android:textSize="?attr/TextSizeBody"/> + android:id="@+id/account_register_new" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="8dp" + android:text="@string/register_account" + android:textColor="@color/black87" + android:textSize="?attr/TextSizeBody"/> + + + + + + + - - + - + android:textSize="?attr/TextSizeBody"/> +