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

COIL ことはじめ

Sponsored · SiteGround - Reliable hosting with speed, security, and support you can count on.
Avatar for Mizuki Furusawa Mizuki Furusawa
September 10, 2019

COIL ことはじめ

Avatar for Mizuki Furusawa

Mizuki Furusawa

September 10, 2019
Tweet

Other Decks in Programming

Transcript

  1. Whoami • Mizuki Furusawa (@mzkii) • 2019/4 ~ CyberAgent, Inc.

    • λοϓϧ஀ੜ • Android Engineer • Kotlin/Java/C/C++/Python/Cats
  2. Coroutine Image Loader “An image loading library for Android backed

    by Kotlin Coroutines.” Fast / Lightweight / Easy to use / Modern
  3. αϙʔτ͞Ε͍ͯΔσʔλܗࣜ • String (mapped to a Uri) • HttpUrl •

    Uri (android.resource, content, file, http, and https schemes only) • File • @DrawableRes Int • Drawable • Bitmap +α GIF SVG (0.7.0)
  4. ࢖͍ํ • “To load an image into an ImageView, 


    use the load extension function:”
  5. Transformations • Glide ΍ Piccaso ͷΑ͏ʹɺ
 COIL ʹ͸ҎԼͷը૾Ճ޻༻ͷΫϥε͕ඪ४Ͱ༻ҙ͞Ε͍ͯΔɻ • BlurTransformation

    • CircleCropTransformation • GrayscaleTransformation • RoundedCornersTransformation
  6. Coil-transformations • 3rd party ͷϥΠϒϥϦ΋ެ։͞Ε͍ͯΔ (relies on GPUImage) • ColorFilterTransformation

    • CropTransformation (top, center, bottom) • MaskTransformation • SquareCropTransformation • PixelationFilterTransformation • ContrastFilterTransformation • …and more
  7. ImageLoader • “Image Loaders are service objects that handle image

    requests with load and get. They handle caching, image decoding, request management, bitmap pooling, memory management, and more.”
  8. ImageViews.kt • “Image Loaders are service objects that handle image

    requests with load and get. They handle caching, image decoding, request management, bitmap pooling, memory management, and more.”
  9. ImageViews.kt • “Image Loaders are service objects that handle image

    requests with load and get. They handle caching, image decoding, request management, bitmap pooling, memory management, and more.”
  10. RealImageLoader • Mapper • Fetcher • Decoder 3FBM*NBHF-PBEFS )UUQ6SM'FUDIFS )UUQ6SM

    #V⒎FSFE4PVSDF 4USJOH.BQQFS 63- 4USJOH 6SJ )UUQ6SJ.BQQFS 6SJ)UUQ6SM #JUNBQ'BDUPSZ %FDPEFS #V⒎FSFE4PVSDF %SBXBCMF
  11. ·ͱΊ • ػೳతʹ͸ Glide ΍ Piccaso ͳͲଞͷը૾ϥΠϒϥϦͱେମҰॹ • COIL ͸

    Glide ΍ Fresco ͷը૾ϥΠϒϥϦͱൺ΂ͯܰྔ • Glide ͷ8෼ͷ1ͷαΠζ • ଞͷը૾ϥΠϒϥϦͱൺ΂ͯΑΓ Kotlin Ά͍ॻ͖ํ͕Ͱ͖Δ • Dynamic image sampling Λద੾ʹ࢖͑͹ UX Λམͱͣ͞ʹ
 ϝϞϦͷ࢖༻ྔΛ཈͑Δ͜ͱ͕Ͱ͖Δ