Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Support Vector Drawable

takahirom
March 16, 2016
2k

Support Vector Drawable

takahirom

March 16, 2016
Tweet

Transcript

  1. "OESPJE4UVEJPTVQQPSU GPS7FDUPS%SBXBCMF w ϝϦοτ w QOHϑΝΠϧͳͷͰࠓ·ͰͱมΘΒͣʹදࣔ͞ΕΔ w σϝϦοτ w BQLαΠζ͕େ͖͘ͳΔ

    w ΞχϝʔγϣϯͰ͖ͳ͍ w େ͖͕͞ҧ͏ͱߥ͘ͳΔ *NBHF7JFXͷXJEUIΛઃఆ͍ͯ͠Δ࣌ͳͲ  w BBQUͱ͍͏Ϗϧυ࣌ʹ૸ΔϦιʔεΛॲཧ͢ΔίϚϯυ͕উखʹੜ੒͢ΔͱࢥΘΕΔ CVJME UPPMTΑΓBBQUίϚϯυʹOPWFSTJPOWFDUPSTͱ͍͏Φϓγϣϯ͕͋ΔͨΊ
  2. छྨͷ7FDUPS%SBXBCMFͷ ར༻ํ๏·ͱΊ 7FDUPS%SBXCMF "OESPJE4UVEJP TVQQPSUGPS 7FDUPS%SBXBCMF 7FDUPS%SBXBCMF $PNQBU "1*-FWFM 

      ੩ࢭը ˓ ˓ ˓ BQLαΠζ ˓ º ˓ Ξχϝʔγϣϯ ˓ º Ҏ্Ͱ͸˓ ˚ Ҏ্Ͱ͸˓ େ͖͞มߋ ˓ º Ҏ্Ͱ͸˓ ˓
  3. 4VQQPSU7FDUPS%SBXBCMF ಋೖํ๏ w BBQUͷͨΊͷΦϓγϣϯॻ͘ w ˠ"OESPJE4UVEJPTVQQPSUGPS7FDUPS%SBXBCMFΛࢭΊΔͨΊͩͱࢥΘΕΔ (SBEMF1MVHJOҎલ BOESPJE\ EFGBVMU$POpH\ HFOFSBUFE%FOTJUJFT<>

    ^ BBQU0QUJPOT\ BEEJUJPOBM1BSBNFUFSTOPWFSTJPOWFDUPST ^ ^ (SBEMF1MVHJOҎ߱ BOESPJE\ EFGBVMU$POpH\ WFDUPS%SBXBCMFTVTF4VQQPSU-JCSBSZUSVF ^ ^
  4. ᶄؒʹ%SBXBCMFΛڬΉ ํ๏ w ؒʹ4UBUF-JTU%SBXBCMF΍*OTFU%SBXBCMFͳͲ͕ೖͬ ͍ͯΕ͹BQQTSD$PNQBUͰࢦఆ͠ͳͯ͘΋0, drawable/selector.xml <?xml version="1.0" encoding="utf-8"?>
 <selector

    xmlns:android=“…”>
 <item android:drawable="@drawable/ ic_android_black_24dp"/>
 </selector> layout/layout.xml <ImageView
 android:id="@+id/image"
 android:src="@drawable/selector"
 android:layout_width="wrap_content"
 android:layout_height="wrap_content"/>
  5. 4VQQPSU7FDUPS%SBXBCMF ׂͱ஗͍ 40&    4VQQPSU7FDUPS%SBXBCMF TFU*NBHF3FTPVSDF NT NT

    NT #JUNBQ TFU*NBHF3FTPVSDF NT NT NT ը૾Ұݸ͋ͨΓͷ࣌ؒ
  6. 7FDUPS%SBXBCMFͱ PCKFDU"OJNBUPSΛ༻ҙ͢Δ <?xml version="1.0" encoding="utf-8"?>
 <animated-vector 
 xmlns:android=“…”
 android:drawable="@drawable/vectordrawable" >


    <target
 android:name="rotationGroup"
 android:animation="@anim/rotation" />
 </animated-vector> <vector xmlns:android=“…”
 android:height="64dp"
 android:width="64dp"
 android:viewportHeight="600"
 android:viewportWidth="600" >
 <group
 android:name="rotationGroup"
 android:pivotX="300.0"
 android:pivotY="300.0"
 android:rotation="45.0" >
 <path
 android:name="v"
 android:fillColor="#000000"
 android:pathData="M300,70 …” /> </group>
 </vector> BOJNBUFEWFDUPS WFDUPSESXBCMFYNM <objectAnimator
 xmlns:android=“…”
 android:duration="6000"
 android:propertyName="rotation"
 android:valueFrom="0"
 android:valueTo="360"/>
  7. ໊લΛἧ͑ͯԿΛΞχϝʔγϣϯ͢Δ ͔ࢦఆ͢Δ <?xml version="1.0" encoding="utf-8"?>
 <animated-vector 
 xmlns:android=“…”
 android:drawable="@drawable/ vectordrawable"

    >
 <target
 android:name="rotationGroup"
 android:animation="@anim/rotation" />
 </animated-vector> <vector xmlns:android=“…”
 android:height="64dp"
 android:width="64dp"
 android:viewportHeight="600"
 android:viewportWidth="600" >
 <group
 android:name="rotationGroup"
 android:pivotX="300.0"
 android:pivotY="300.0"
 android:rotation="45.0" >
 <path
 android:name="v"
 android:fillColor="#000000"
 android:pathData="M300,70 …” /> </group>
 </vector> BOJNBUFEWFDUPS WFDUPSESXBCMFYNM <objectAnimator
 xmlns:android=“…”
 android:duration="6000"
 android:propertyName="rotation"
 android:valueFrom="0"
 android:valueTo="360"/>