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

MotionLayoutを使ってクリスマスなアプリを作った

Young
December 24, 2018

 MotionLayoutを使ってクリスマスなアプリを作った

Young

December 24, 2018
Tweet

More Decks by Young

Other Decks in Programming

Transcript

  1. Motion Layout ʁ • Google I/O 2018Ͱൃද͞Εͨ • MotionLayout͸ConstraintLayout 2.0ʹؚ·Ε͍ͯΔ

    • ·ͩalpha൛ • ϢʔβʔͷΠϯλϥΫγϣϯ౳ʹԠͯ͡ɺগͳ͍ιʔε ίʔυͰɺ͵Δ͵ΔͳΞχϝʔγϣϯΛඳըͰ͖Δ
  2. override fun onInterceptTouchEvent(ev: MotionEvent): Boolean { return if (isPassTouchEventToChild) {

    // ࢠͷViewʹΠϕϯτΛྲྀ͢ false } else { // എܠͷϨΠΞ΢τʹΠϕϯτΛྲྀ͢ true } } LayoutͷTouchEventͷ੍ޚ
  3. LayoutͷTouchEventͷ੍ޚ എܠͷLayout CustomLayout MotionLayout ͱͳ͔͍ CustomLayout onInterceptTouchEvent : false ↓

    MotionLayoutͷλονΠϕϯτ ※ എܠͷLayoutͷλονΠϕϯτ͸ൃ ੜ͠ͳ͍ 5PVDI
  4. LayoutͷTouchEventͷ੍ޚ എܠͷLayout CustomLayout MotionLayout ͱͳ͔͍ CustomLayout onInterceptTouchEvent : true ↓

    എܠͷLayoutͷλονΠϕϯτ ※ MotionLayoutͷλονΠϕϯτ͸ൃ ੜ͠ͳ͍ 5PVDI