Wątek przeniesiony 2018-11-24 23:33 z Java przez furious programming.

ImageView vector zamula aplikację

Odpowiedz Nowy wątek
2018-11-24 21:49
0

Cześć pany i panie.
Dawno mnie tu nie było, ale kilka dni temu wróciłem do programowania i od razu napotkałem mały problem.
A mianowicie:
w ImageView ładuję tego oto poniżej drobnego wektora i kilka innych jemu podobnych, a po odpaleniu apki na smartfonie pojawia się miła niespodzianka. Apka po odpaleniu fragmentu z zegarami staje się strasznie zamulona. Próbowałem pakować mipmapy, ale jakość zegarów jest powalająca, a że apkę piszę dla zabawy i dla siebie nie może mieć żadnych mankamentów, a przynajmniej nie na pierwszy rzut okiem.
Ktoś ma pomysł jak to rozwiązać, albo spotkał się z podobnym problemem?

<ImageView
        android:id="@+id/iv_fuel"
        android:layout_width="65dp"
        android:layout_height="130dp"
        android:layout_alignParentStart="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentBottom="true"
        android:layout_marginStart="0dp"
        android:layout_marginLeft="0dp"
        android:layout_marginBottom="0dp"
        android:baselineAlignBottom="true"
        android:scaleType="centerCrop"
        app:srcCompat="@drawable/gauge_fuel_medium_black" />

kod jednego z zegarów:

<vector android:height="842dp" android:viewportHeight="841.89"
    android:viewportWidth="841.89" android:width="842dp"
    xmlns:aapt="http://schemas.android.com/aapt" xmlns:android="http://schemas.android.com/apk/res/android">
    <path android:fillType="evenOdd" android:pathData="M210.434,0v841.89c232.419,0 420.905,-188.488 420.905,-420.985C631.339,188.495 442.853,0 210.434,0z">
        <aapt:attr name="android:fillColor">
            <gradient android:endX="210.43356" android:endY="420.9448"
                android:startX="631.33887" android:startY="420.9448" android:type="linear">
                <item android:color="#FFE5E2DF" android:offset="0"/>
                <item android:color="#FFDED9D6" android:offset="0"/>
                <item android:color="#FFCFCAC9" android:offset="0.063"/>
                <item android:color="#FFA8A4A7" android:offset="0.1833"/>
                <item android:color="#FF8B878D" android:offset="0.264"/>
                <item android:color="#FFF3F4F4" android:offset="0.5225"/>
                <item android:color="#FFE5E5E6" android:offset="0.5842"/>
                <item android:color="#FFC0BEC0" android:offset="0.7027"/>
                <item android:color="#FF858085" android:offset="0.8647"/>
                <item android:color="#FF807B80" android:offset="0.8764"/>
                <item android:color="#FFD1D3D4" android:offset="1"/>
                <item android:color="#FFA7A9AC" android:offset="1"/>
            </gradient>
        </aapt:attr>
    </path>
    <path android:fillColor="#FF000000" android:fillType="evenOdd" android:pathData="M210.353,18.079c219.813,0 398.016,176.879 398.016,394.977c0,1.129 -0.033,2.242 -0.033,3.371C606.501,199.893 429.026,24.83 210.353,24.83V18.079z"/>
    <path android:fillType="evenOdd" android:pathData="M210.437,826.552V24.312c221.461,0 401.074,179.614 401.074,401.158C611.511,646.939 431.897,826.552 210.437,826.552z">
        <aapt:attr name="android:fillColor">
            <gradient android:endX="410.97314" android:endY="19.7451"
                android:startX="410.97314" android:startY="832.0298" android:type="linear">
                <item android:color="#FF9DBBDA" android:offset="0"/>
                <item android:color="#FF000000" android:offset="1"/>
            </gradient>
        </aapt:attr>
    </path>
    <path android:fillType="evenOdd" android:pathData="M210.353,826.833c219.813,0 398.016,-182.229 398.016,-406.933c0,-1.164 -0.033,-2.31 -0.033,-3.474c-1.834,223.091 -179.309,403.452 -397.982,403.452V826.833z">
        <aapt:attr name="android:fillColor">
            <gradient android:endX="415.36835" android:endY="966.8242"
                android:startX="406.06345" android:startY="433.7505" android:type="linear">
                <item android:color="#FFFFFFFF" android:offset="0"/>
                <item android:color="#FFFFFFFF" android:offset="1"/>
            </gradient>
        </aapt:attr>
    </path>
    <path android:fillColor="#231F20" android:fillType="evenOdd" android:pathData="M210.402,797.732V53.124c205.055,0 372.288,167.25 372.288,372.303C582.69,630.49 415.457,797.732 210.402,797.732z"/>
    <path android:fillColor="#FF000000" android:pathData="M210.402,49.939c103.665,0 197.532,42.042 265.498,109.991c67.95,67.958 109.982,161.833 109.982,265.506c0,103.665 -42.032,197.539 -109.982,265.496c-67.966,67.95 -161.833,109.992 -265.498,109.992V49.939L210.402,49.939zM210.402,794.548c101.899,0 194.187,-41.329 260.979,-108.123c66.796,-66.803 108.133,-159.082 108.133,-260.988c0,-101.916 -41.337,-194.194 -108.133,-260.997C404.589,97.645 312.302,56.325 210.402,56.325V794.548z"/>
    <path android:fillType="evenOdd" android:pathData="M210.402,592.933l1.597,188.768c139.279,0 250.637,-99.879 250.637,-138.191C462.636,605.195 349.683,592.933 210.402,592.933z">
        <aapt:attr name="android:fillColor">
            <gradient android:endX="343.15576" android:endY="984.8892"
                android:startX="334.85306" android:startY="597.4351" android:type="linear">
                <item android:color="#FF181818" android:offset="0"/>
                <item android:color="#FFEDC1CC" android:offset="1"/>
            </gradient>
        </aapt:attr>
    </path>
    <path android:fillType="evenOdd" android:pathData="M210.395,310.472c93.688,0 187.375,14.972 281.063,44.918c31.385,0 52.937,-32.064 41.099,-61.131C480.774,167.233 356.017,77.682 210.402,77.682L210.395,310.472z">
        <aapt:attr name="android:fillColor">
            <gradient android:endX="363.73077" android:endY="-227.4819"
                android:startX="377.47366" android:startY="559.8501" android:type="linear">
                <item android:color="#FF1A2323" android:offset="0"/>
                <item android:color="#FFF0C2C6" android:offset="1"/>
            </gradient>
        </aapt:attr>
    </path>
    <path android:fillColor="#FFFFFF" android:pathData="M533.601,270.6l-16.648,8.484c-2.117,1.058 -3.756,-2.181 -1.672,-3.255l16.65,-8.491L533.601,270.6L533.601,270.6z"/>
    <path android:fillColor="#FFFFFF" android:pathData="M558.319,336.217l-18.033,4.839c-2.293,0.597 -3.23,-2.921 -0.971,-3.542l18.064,-4.831L558.319,336.217L558.319,336.217z"/>
    <path android:fillColor="#FFFFFF" android:pathData="M562.331,353.328l-18.273,3.892c-2.307,0.469 -3.055,-3.088 -0.779,-3.589l18.289,-3.884L562.331,353.328L562.331,353.328z"/>
    <path android:fillColor="#FFFFFF" android:pathData="M565.435,370.629l-18.432,2.921c-2.355,0.358 -2.912,-3.239 -0.605,-3.621l18.48,-2.921L565.435,370.629L565.435,370.629z"/>
    <path android:fillColor="#FFFFFF" android:pathData="M567.647,388.066l-18.576,1.95c-2.371,0.231 -2.736,-3.382 -0.412,-3.645l18.605,-1.95L567.647,388.066L567.647,388.066z"/>
    <path android:fillColor="#FFFFFF" android:pathData="M568.921,405.59l-18.654,0.979c-2.355,0.111 -2.547,-3.525 -0.207,-3.661l18.67,-0.971L568.921,405.59L568.921,405.59z"/>
    <path android:fillColor="#FFFFFF" android:pathData="M568.729,440.727l-18.654,-0.972c-2.355,-0.143 -2.164,-3.771 0.174,-3.66l18.672,0.979L568.729,440.727L568.729,440.727z"/>
    <path android:fillColor="#FFFFFF" android:pathData="M567.249,458.244l-18.574,-1.95c-2.34,-0.263 -1.959,-3.884 0.381,-3.646l18.592,1.951L567.249,458.244L567.249,458.244z"/>
    <path android:fillColor="#FFFFFF" android:pathData="M564.878,475.648l-18.447,-2.912c-2.34,-0.391 -1.768,-3.979 0.557,-3.621l18.463,2.92L564.878,475.648L564.878,475.648z"/>
    <path android:fillColor="#FFFFFF" android:pathData="M561.567,492.91l-18.258,-3.875c-2.322,-0.51 -1.559,-4.066 0.732,-3.59l18.289,3.893L561.567,492.91L561.567,492.91z"/>
    <path android:fillColor="#FFFFFF" android:pathData="M557.38,509.981l-18.049,-4.831c-2.275,-0.629 -1.338,-4.146 0.939,-3.549l18.049,4.847L557.38,509.981L557.38,509.981z"/>
    <path android:fillColor="#FFFFFF" android:pathData="M552.288,526.797l-17.764,-5.763c-2.244,-0.748 -1.115,-4.209 1.113,-3.493l17.795,5.786L552.288,526.797L552.288,526.797z"/>
    <path android:fillColor="#FFFFFF" android:pathData="M546.335,543.335l-17.43,-6.686c-2.213,-0.867 -0.891,-4.258 1.289,-3.43l17.461,6.701L546.335,543.335L546.335,543.335z"/>
    <path android:fillColor="#FFFFFF" android:pathData="M539.522,559.539l-17.063,-7.593c-2.15,-0.979 -0.67,-4.298 1.479,-3.358l17.08,7.608L539.522,559.539L539.522,559.539z"/>
    <path android:fillColor="#FFFFFF" android:pathData="M531.866,575.359l-16.633,-8.475c-2.102,-1.091 -0.445,-4.33 1.639,-3.271l16.666,8.492L531.866,575.359L531.866,575.359z"/>
    <path android:fillColor="#FFFFFF" android:pathData="M522.698,592.39l3.453,-6l-30.672,-17.707c-3.867,-2.236 -7.32,3.764 -3.453,6L522.698,592.39L522.698,592.39z"/>
    <path android:fillColor="#FFFFFF" android:pathData="M569.413,424.945h-35.414c-4.473,0 -4.473,-6.931 0,-6.931h35.414V424.945L569.413,424.945z"/>
    <path android:fillColor="#FFFFFF" android:pathData="M541.081,286.508l-17.063,7.601c-2.164,0.947 -3.645,-2.379 -1.512,-3.343l17.078,-7.6L541.081,286.508L541.081,286.508z"/>
    <path android:fillColor="#FFFFFF" android:pathData="M547.64,302.736l-17.43,6.701c-2.211,0.828 -3.518,-2.563 -1.32,-3.414l17.445,-6.701L547.64,302.736L547.64,302.736z"/>
    <path android:fillColor="#FFFFFF" android:pathData="M553.417,319.337l-17.764,5.778c-2.244,0.716 -3.357,-2.746 -1.145,-3.486l17.779,-5.77L553.417,319.337L553.417,319.337z"/>
    <path android:fillColor="#FFFFFF" android:pathData="M526.151,256.569l-3.453,-6l-30.672,17.708c-3.867,2.236 -0.414,8.237 3.453,6L526.151,256.569z"/>
    <path android:fillColor="#FFFFFF" android:pathData="M436.46,274.436h5.746v17.111h5.746v-24.337h-4.313c-0.111,0.581 -0.318,1.106 -0.637,1.568c-0.303,0.469 -0.701,0.875 -1.162,1.226c-0.445,0.342 -0.939,0.628 -1.48,0.859s-1.082,0.406 -1.623,0.509c-0.541,0.111 -1.051,0.183 -1.545,0.183h-0.732V274.436L436.46,274.436zM448.286,297.977h2.785l12.766,-30.767h-2.785L448.286,297.977L448.286,297.977zM465.923,274.436h5.73v17.111h5.746v-24.337h-4.314c-0.111,0.581 -0.318,1.106 -0.621,1.568c-0.318,0.469 -0.715,0.875 -1.162,1.226c-0.461,0.342 -0.955,0.628 -1.496,0.859c-0.525,0.231 -1.066,0.406 -1.607,0.509c-0.541,0.111 -1.066,0.183 -1.543,0.183h-0.732V274.436z"/>
    <path android:fillColor="#FFFFFF" android:pathData="M472.671,417.233h5.73v17.103h5.746V410h-4.314c-0.111,0.581 -0.318,1.106 -0.619,1.568c-0.318,0.469 -0.701,0.883 -1.162,1.226c-0.463,0.342 -0.955,0.628 -1.496,0.859c-0.525,0.231 -1.066,0.406 -1.607,0.517c-0.543,0.112 -1.066,0.175 -1.545,0.175h-0.732V417.233L472.671,417.233zM484.497,440.775h2.77L500.032,410h-2.785L484.497,440.775L484.497,440.775zM519.228,430.094h-11.889c0.254,-0.462 0.557,-0.884 0.891,-1.249c0.35,-0.366 0.732,-0.717 1.178,-1.035c0.43,-0.318 0.908,-0.637 1.449,-0.955c0.525,-0.318 1.113,-0.66 1.766,-1.034c1.354,-0.796 2.467,-1.56 3.344,-2.292c0.859,-0.725 1.543,-1.449 2.021,-2.156c0.477,-0.701 0.811,-1.426 1.002,-2.149c0.191,-0.731 0.271,-1.48 0.271,-2.276c-0.018,-1.066 -0.16,-2.006 -0.447,-2.793c-0.285,-0.796 -0.684,-1.464 -1.162,-2.021c-0.492,-0.549 -1.033,-1.003 -1.623,-1.361c-0.588,-0.358 -1.193,-0.637 -1.814,-0.836c-0.621,-0.199 -1.209,-0.35 -1.766,-0.438c-0.541,-0.087 -1.02,-0.143 -1.434,-0.167c-0.398,-0.024 -0.684,-0.032 -0.859,-0.032c-1.543,0.008 -2.881,0.191 -3.994,0.533c-1.1,0.351 -2.039,0.82 -2.77,1.401c-0.732,0.597 -1.322,1.25 -1.736,1.982c-0.43,0.732 -0.732,1.48 -0.906,2.244c-0.191,0.772 -0.271,1.512 -0.271,2.228v0.725h5.316v-0.868c0,-0.82 0.176,-1.52 0.525,-2.125c0.334,-0.597 0.813,-1.058 1.434,-1.385c0.619,-0.318 1.352,-0.485 2.18,-0.493c0.525,0 1.02,0.071 1.48,0.207c0.461,0.135 0.875,0.35 1.242,0.645c0.365,0.286 0.652,0.668 0.859,1.138c0.207,0.454 0.318,1.019 0.318,1.664c0,0.629 -0.096,1.194 -0.303,1.687c-0.191,0.494 -0.494,0.947 -0.875,1.361c-0.398,0.422 -0.877,0.836 -1.449,1.258c-0.572,0.414 -1.227,0.859 -1.975,1.345s-1.592,1.034 -2.498,1.655c-1.273,0.859 -2.324,1.672 -3.135,2.42c-0.797,0.732 -1.418,1.448 -1.863,2.125c-0.445,0.684 -0.748,1.377 -0.906,2.076c-0.176,0.701 -0.24,1.449 -0.24,2.244v0.972h18.639V430.094z"/>
    <path android:fillColor="#FFFFFF" android:pathData="M468.167,579.434c0.27,0.009 0.637,-0.008 1.113,-0.048c0.479,-0.039 1.02,-0.135 1.625,-0.286c0.604,-0.159 1.24,-0.414 1.893,-0.757c0.67,-0.334 1.307,-0.803 1.926,-1.408c0.605,-0.597 1.18,-1.361 1.672,-2.292c0.494,-0.931 0.908,-2.054 1.193,-3.382c0.303,-1.33 0.447,-2.896 0.463,-4.688c-0.016,-1.799 -0.16,-3.367 -0.463,-4.695c-0.285,-1.322 -0.699,-2.451 -1.193,-3.383c-0.492,-0.924 -1.066,-1.688 -1.672,-2.284c-0.619,-0.604 -1.256,-1.074 -1.926,-1.417c-0.652,-0.342 -1.289,-0.588 -1.893,-0.748c-0.605,-0.158 -1.146,-0.254 -1.625,-0.294c-0.477,-0.032 -0.844,-0.056 -1.113,-0.048c-0.271,-0.008 -0.637,0.016 -1.115,0.048c-0.477,0.04 -1.018,0.136 -1.623,0.294c-0.621,0.16 -1.24,0.406 -1.91,0.748c-0.652,0.343 -1.289,0.813 -1.91,1.417c-0.619,0.597 -1.178,1.36 -1.67,2.284c-0.494,0.932 -0.893,2.061 -1.195,3.383c-0.285,1.328 -0.445,2.896 -0.445,4.695c0,1.791 0.16,3.357 0.445,4.688c0.303,1.328 0.701,2.451 1.195,3.382c0.492,0.931 1.051,1.695 1.67,2.292c0.621,0.605 1.258,1.074 1.91,1.408c0.67,0.343 1.289,0.598 1.91,0.757c0.605,0.151 1.146,0.247 1.623,0.286C467.53,579.426 467.896,579.443 468.167,579.434L468.167,579.434zM468.167,575.201c-0.797,-0.016 -1.465,-0.199 -1.99,-0.565s-0.955,-0.859 -1.273,-1.464c-0.318,-0.613 -0.572,-1.298 -0.732,-2.046c-0.158,-0.756 -0.27,-1.528 -0.318,-2.308c-0.047,-0.788 -0.063,-1.536 -0.063,-2.244c0,-0.717 0.016,-1.465 0.063,-2.252c0.049,-0.781 0.16,-1.553 0.318,-2.309c0.16,-0.756 0.414,-1.433 0.732,-2.045c0.318,-0.613 0.748,-1.099 1.273,-1.465c0.525,-0.357 1.193,-0.549 1.99,-0.557c0.813,0.008 1.496,0.191 2.037,0.549c0.525,0.357 0.955,0.844 1.273,1.44c0.334,0.604 0.557,1.281 0.717,2.038c0.143,0.748 0.254,1.52 0.303,2.315c0.031,0.788 0.063,1.552 0.047,2.284c0.016,0.725 -0.016,1.488 -0.047,2.275c-0.049,0.797 -0.16,1.568 -0.303,2.316c-0.16,0.756 -0.383,1.433 -0.717,2.029c-0.318,0.605 -0.748,1.09 -1.273,1.448C469.663,575.001 468.979,575.193 468.167,575.201z"/>
    <path android:fillColor="#FFFFFF" android:fillType="evenOdd" android:pathData="M357.896,137.805h33.441c2.133,0 3.883,2.021 3.883,4.497v33.06c3.789,-0.247 10.266,0.104 10.266,5.372v24.52c0,2.61 0.494,4.083 1.322,4.831c0.811,0.724 2.18,0.947 3.836,0.947h0.031v0.008c1.529,-0.008 2.738,-0.525 3.566,-1.321c0.764,-0.748 1.193,-1.759 1.193,-2.825v-0.016v-34.603l0.717,-7.274l-2.596,-6.653c-2.195,-3.589 -4.439,-5.245 -4.439,-5.261l1.432,-1.91c0.016,0.008 2.531,1.87 4.982,5.849l4.711,2.96l0.955,7.999l-0.971,4.29v34.603v0.016c0,2.348 -0.939,4.592 -2.643,6.263c-1.672,1.616 -4.027,2.658 -6.908,2.666v0.008h-0.031c-2.754,0 -5.174,-0.501 -7.035,-2.18c-1.848,-1.656 -2.914,-4.266 -2.914,-8.396v-24.52c0,-1.106 -3.311,-0.883 -5.475,-0.621v34.882h2.881c1.512,0 2.738,1.233 2.738,2.746v3.749c0,1.512 -1.227,2.746 -2.738,2.746H351.13c-1.512,0 -2.738,-1.233 -2.738,-2.746v-3.749c0,-1.512 1.227,-2.746 2.738,-2.746h2.881v-72.692C354.011,139.827 355.763,137.805 357.896,137.805L357.896,137.805zM362.368,142.803c-2.197,0 -3.996,1.799 -3.996,3.995v22.729c0,2.196 1.799,3.995 3.996,3.995h24.479c2.213,0 4.012,-1.799 4.012,-3.995v-22.729c0,-2.196 -1.799,-3.995 -4.012,-3.995H362.368z"/>
</vector>

Pozdrawiam, Sławek.

Pozostało 580 znaków

2018-11-24 23:31
0

Sam sobie odpowiem, nie pamiętam czy tu wolno, ale będzie najwyżej ban:)
https://google.com

czytać, dożo czytać

oto odpowiedź: https://medium.com/upday-devs/optimiz[...]vector-drawables-680a4c456286

do zamkniecia

edytowany 1x, ostatnio: slawekh666, 2018-11-25 00:58
Pewnie że wolno – jeśli sam rozwiązałeś swój problem, to bardzo fajną praktyką jest podzielenie się tym rozwiązaniem. Niejeden w przyszłości trafi do tego wątku – będzie miał rozwiązanie opisane, dzięki czemu sam nie będzie musiał zakładać wątku. - furious programming 2018-11-25 00:35

Pozostało 580 znaków

Odpowiedz
Liczba odpowiedzi na stronę

1 użytkowników online, w tym zalogowanych: 0, gości: 1, botów: 0