How to implement TimetablelLayoutManager

How to implement TimetablelLayoutManager

5f533179da1c82722252cbcb93e7356f?s=128

Moyuru Aizawa

March 06, 2019
Tweet

Transcript

  1. %SPJE,BJHJΞϓϦͷ λΠϜςʔϒϧΛࢧ͑Δٕज़ !.PZVSV"J[BXB

  2. MoyuruAizawa Moyuru Aizawa
 Software engineer of CATS Div. CyberAgent Inc.

    
 Previously at Pairs Div. Eureka Inc.
  3. %SPJE,BJHJDPOGFSFODFBQQ

  4. %SPJE,BJHJDPOGFSFODFBQQ

  5. 5JNFUBCMF-BZPVUBMQIB3FMFBTFE

  6. ‣ 5JNFUBCMFΛදࣔ͢ΔͨΊͷ-BZPVU.BOBHFS ‣ ࣌ࠁΛදࣔ͢ΔͨΊͷ*UFN%FDPSBUJPO ‣ ΧϥϜ໊Λදࣔ͢ΔͨΊͷ*UFN%FDPSBUJPO ‣ ݱࡏ࣌ࠁΛදࣔ͢ΔͨΊͷ7JFXPS*UFN%FDPSBUJPO ࣮૷༧ఆ 5JNFUBCMF-BZPVU

  7. ‣ 3FDZDMFS7JFXͱ͸  ‣ -BZPVU.BOBHFSͱ͸  ‣ -BZPVU.BOBHFS͕΍͍ͬͯΔ͜ͱ ‣ 5JNFUBCMF-BZPVU.BOBHFSͷ࣮૷

    "HFOEB
  8. 3FDZDMFS7JFXͱ͸

  9. ‣ ଟྔͷΞΠςϜΛදࣔ͢Δͷʹదͨ͠7JFX(SPVQ ‣ ը໘ʹදࣔ͞ΕΔ෼͚ͩΞΠςϜΛඳը͢Δ ‣ ֦ுੑ͕ߴ͍ ‣ %FDPSBUJPO ‣ "OJNBUJPO

    ‣ ʜ 3FDZDMFS7JFXͱ͸
  10. ‣ "EBQUFS ‣ -BZPVU.BOBHFS ‣ *UFN%FDPSBUJPO ‣ *UFN"OJNBUPS ‣ *UFN5PVDI)FMQFS

    ‣ 4OBQ)FMQFS ‣ 3FDZDMFE7JFX1PPM ‣ %JGG6UJM 3FDZDMFS7JFXͱ͸
  11. -BZPVU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Λݶఆ͢Ε͹ଟগ͸ָʹͳΔ
 ͦΕͰ΋׳Ε͍ͯͳ͚Ε͹݁ߏ͔͔࣌ؒΔ͔΋

  25. -BZPVU.BOBHFS͕΍͍ͬͯΔ͜ͱ

  26. ‣ PO-BZPVU$IJMESFO ‣ QFSJPETͷ৘ใऩू ‣ JOJUJBMMBZPVU ‣ TDSPMM7FSUJDBMMZ#ZTDSPMM)PSJ[POUBMMZ#Z ‣ DIJMEWJFXTͷҠಈ

    ‣ ݟ͑ͳ͘ͳͬͨDIJMEWJFXΛSFNPWF ‣ ۭ͖εϖʔεʹDIJMEWJFXΛBEE -BZPVU.BOBHFS͕΍͍ͬͯΔ͜ͱ ͬ͘͟Γ
  27. PO-BZPVU$IJMESFO ‣ ϨΠΞ΢τͷॳظԽ ‣ ը໘ʹදࣔ͞ΕΔ෼͚ͩWJFXΛ഑ஔ ͍ͯ͘͠

  28. PO-BZPVU$IJMESFO ‣ ϨΠΞ΢τͷॳظԽ ‣ ը໘ʹදࣔ͞ΕΔ෼͚ͩWJFXΛ഑ஔ ͍ͯ͘͠

  29. TDSPMM7FSUJDBMMZ#Z ‣ WJFXΛεϥΠυͤ͞Δ ‣ ݟ͑ͳ͘ͳͬͨWJFXΛফ͢ ‣ ۭ͖εϖʔεʹWJFXΛ௥Ճ͢Δ

  30. TDSPMM7FSUJDBMMZ#Z ‣ WJFXΛεϥΠυͤ͞Δ ‣ ݟ͑ͳ͘ͳͬͨWJFXΛফ͢ ‣ ۭ͖εϖʔεʹWJFXΛ௥Ճ͢Δ

  31. TDSPMM7FSUJDBMMZ#Z ‣ WJFXΛεϥΠυͤ͞Δ ‣ ݟ͑ͳ͘ͳͬͨWJFXΛফ͢ ‣ ۭ͖εϖʔεʹWJFXΛ௥Ճ͢Δ

  32. TDSPMM7FSUJDBMMZ#Z ‣ WJFXΛεϥΠυͤ͞Δ ‣ ݟ͑ͳ͘ͳͬͨWJFXΛফ͢ ‣ ۭ͖εϖʔεʹWJFXΛ௥Ճ͢Δ

  33. TDSPMM)PSJ[POUBMMZ#Z ‣ WJFXΛεϥΠυͤ͞Δ ‣ ݟ͑ͳ͘ͳͬͨWJFXΛফ͢ ‣ ۭ͖εϖʔεʹWJFXΛ௥Ճ͢Δ

  34. TDSPMM)PSJ[POUBMMZ#Z ‣ WJFXΛεϥΠυͤ͞Δ ‣ ݟ͑ͳ͘ͳͬͨWJFXΛফ͢ ‣ ۭ͖εϖʔεʹWJFXΛ௥Ճ͢Δ

  35. TDSPMM)PSJ[POUBMMZ#Z ‣ WJFXΛεϥΠυͤ͞Δ ‣ ݟ͑ͳ͘ͳͬͨWJFXΛফ͢ ‣ ۭ͖εϖʔεʹWJFXΛ௥Ճ͢Δ

  36. TDSPMM)PSJ[POUBMMZ#Z ‣ WJFXΛεϥΠυͤ͞Δ ‣ ݟ͑ͳ͘ͳͬͨWJFXΛফ͢ ‣ ۭ͖εϖʔεʹWJFXΛ௥Ճ͢Δ

  37. 5JNFUBCMF-BZPVU.BOBHFSͷ࣮૷

  38. 5JNFUBCMF-BZPVU.BOBHFSͷ࣮૷ PO-BZPVU$IJMESFO

  39. (0 until itemCount).forEach { val periodInfo = periodLookUp(it) val column

    = columns.getOrPut(periodInfo.columnNumber) { ArrayList() } val period = Period( TimeUnit.MILLISECONDS.toMinutes(periodInfo.startUnixMillis).toInt(), TimeUnit.MILLISECONDS.toMinutes(periodInfo.endUnixMillis).toInt(), periodInfo.columnNumber, adapterPosition = it, positionInColumn = column.size ) periods.add(period) column.add(period) if (it == 0) { firstStartUnixMin = period.startUnixMin lastEndUnixMin = period.endUnixMin } else { firstStartUnixMin = min(period.startUnixMin, firstStartUnixMin) lastEndUnixMin = max(period.endUnixMin, lastEndUnixMin) } } ֤QFSJPEͷ৘ใऩू
  40. (0 until itemCount).forEach { val periodInfo = periodLookUp(it) val column

    = columns.getOrPut(periodInfo.columnNumber) { ArrayList() } val period = Period( TimeUnit.MILLISECONDS.toMinutes(periodInfo.startUnixMillis).toInt(), TimeUnit.MILLISECONDS.toMinutes(periodInfo.endUnixMillis).toInt(), periodInfo.columnNumber, adapterPosition = it, positionInColumn = column.size ) periods.add(period) column.add(period) if (it == 0) { firstStartUnixMin = period.startUnixMin lastEndUnixMin = period.endUnixMin } else { firstStartUnixMin = min(period.startUnixMin, firstStartUnixMin) lastEndUnixMin = max(period.endUnixMin, lastEndUnixMin) } } ֤QFSJPEͷ৘ใऩू
  41. (0 until itemCount).forEach { val periodInfo = periodLookUp(it) val column

    = columns.getOrPut(periodInfo.columnNumber) { ArrayList() } val period = Period( TimeUnit.MILLISECONDS.toMinutes(periodInfo.startUnixMillis).toInt(), TimeUnit.MILLISECONDS.toMinutes(periodInfo.endUnixMillis).toInt(), periodInfo.columnNumber, adapterPosition = it, positionInColumn = column.size ) periods.add(period) column.add(period) if (it == 0) { firstStartUnixMin = period.startUnixMin lastEndUnixMin = period.endUnixMin } else { firstStartUnixMin = min(period.startUnixMin, firstStartUnixMin) lastEndUnixMin = max(period.endUnixMin, lastEndUnixMin) } } ֤QFSJPEͷ৘ใऩू
  42. anchor.leftColumn = 0 val columnCount = columns.size() val offsetY =

    parentTop var offsetX = parentLeft for (columnNumber in 0 until columnCount) { offsetX += addColumn( columns[columnNumber].first(), offsetX, offsetY, true, recycler) anchor.rightColumn = columnNumber if (offsetX > parentRight) break } *OJUJBMMBZPVU
  43. val range = startPeriod.positionInColumn until column.size for (i in range)

    { val period = column[i] val (width, height) = addPeriod(period, direction, offsetX, offsetY, recycler) offsetY += height columnWidth = width if (i == startPeriod.positionInColumn) anchor.top.put(columnNum, period.adapterPosition) anchor.bottom.put(columnNum, period.adapterPosition) if (offsetY > parentBottom) break } *OJUJBMMBZPVU
  44. val range = startPeriod.positionInColumn until column.size for (i in range)

    { val period = column[i] val (width, height) = addPeriod(period, direction, offsetX, offsetY, recycler) offsetY += height columnWidth = width if (i == startPeriod.positionInColumn) anchor.top.put(columnNum, period.adapterPosition) anchor.bottom.put(columnNum, period.adapterPosition) if (offsetY > parentBottom) break } *OJUJBMMBZPVU
  45. anchor.leftColumn = 0 val columnCount = columns.size() val offsetY =

    parentTop var offsetX = parentLeft for (columnNumber in 0 until columnCount) { offsetX += addColumn( columns[columnNumber].first(), offsetX, offsetY, true, recycler) anchor.rightColumn = columnNumber if (offsetX > parentRight) break } *OJUJBMMBZPVU
  46. 5JNFUBCMF-BZPVU.BOBHFSͷ࣮૷ TDSPMM7FSUJDBMMZ#Z

  47. val bottomView = findBottomView() ?: return 0 val period =

    periods.getOrNull(bottomView.adapterPosition) ?: return 0 val bottom = getDecoratedBottom(bottomView) if (period.endUnixMin == lastEndUnixMin) if (bottom == parentBottom) 0 else min(dy, bottom - parentBottom) else dy εΫϩʔϧྔͷܭࢉ
  48. val bottomView = findBottomView() ?: return 0 val period =

    periods.getOrNull(bottomView.adapterPosition) ?: return 0 val bottom = getDecoratedBottom(bottomView) if (period.endUnixMin == lastEndUnixMin) if (bottom == parentBottom) 0 else min(dy, bottom - parentBottom) else dy εΫϩʔϧྔͷܭࢉ
  49. val bottomView = findBottomView() ?: return 0 val period =

    periods.getOrNull(bottomView.adapterPosition) ?: return 0 val bottom = getDecoratedBottom(bottomView) if (period.endUnixMin == lastEndUnixMin) if (bottom == parentBottom) 0 else min(dy, bottom - parentBottom) else dy εΫϩʔϧྔͷܭࢉ
  50. val bottomView = findBottomView() ?: return 0 val period =

    periods.getOrNull(bottomView.adapterPosition) ?: return 0 val bottom = getDecoratedBottom(bottomView) if (period.endUnixMin == lastEndUnixMin) if (bottom == parentBottom) 0 else min(dy, bottom - parentBottom) else dy εΫϩʔϧྔͷܭࢉ
  51. override fun scrollVerticallyBy( dy: Int, recycler: Recycler, state: State ):

    Int { if (dy == 0) return 0 val actualDy = calculateVerticallyScrollAmount(dy) if (actualDy == 0) return 0 offsetChildrenVertical(-actualDy) … } $IJMEWJFXTͷҠಈ
  52. override fun scrollVerticallyBy( dy: Int, recycler: Recycler, state: State ):

    Int { if (dy == 0) return 0 val actualDy = calculateVerticallyScrollAmount(dy) if (actualDy == 0) return 0 offsetChildrenVertical(-actualDy) … } $IJMEWJFXTͷҠಈ
  53. (anchor.leftColumn..anchor.rightColumn) .forEach { columnNum -> val column = columns[columnNum] val

    top = periods[anchor.top[columnNum]] val bottom = periods[anchor.bottom[columnNum]] column.subList( top.positionInColumn, bottom.positionInColumn ).forEach { val view = findViewByPosition(it.adapterPosition)?: return if (getDecoratedBottom(view) >= parentTop) return removeAndRecycleView(view, recycler) val belowPosition = column[it.positionInColumn + 1] .adapterPosition anchor.top.put(columnNum, belowPosition) } } ը໘͔ΒͰͨDIJMEWJFXͷ࡟আ
  54. (anchor.leftColumn..anchor.rightColumn) .forEach { columnNum -> val column = columns[columnNum] val

    top = periods[anchor.top[columnNum]] val bottom = periods[anchor.bottom[columnNum]] column.subList( top.positionInColumn, bottom.positionInColumn ).forEach { val view = findViewByPosition(it.adapterPosition)?: return if (getDecoratedBottom(view) >= parentTop) return removeAndRecycleView(view, recycler) val belowPosition = column[it.positionInColumn + 1] .adapterPosition anchor.top.put(columnNum, belowPosition) } } ը໘͔ΒͰͨDIJMEWJFXͷ࡟আ
  55. (anchor.leftColumn..anchor.rightColumn) .forEach { columnNum -> val column = columns[columnNum] val

    top = periods[anchor.top[columnNum]] val bottom = periods[anchor.bottom[columnNum]] column.subList( top.positionInColumn, bottom.positionInColumn ).forEach { val view = findViewByPosition(it.adapterPosition)?: return if (getDecoratedBottom(view) >= parentTop) return removeAndRecycleView(view, recycler) val belowPosition = column[it.positionInColumn + 1] .adapterPosition anchor.top.put(columnNum, belowPosition) } } ը໘͔ΒͰͨDIJMEWJFXͷ࡟আ
  56. (anchor.leftColumn..anchor.rightColumn) .forEach { columnNum -> val column = columns[columnNum] val

    top = periods[anchor.top[columnNum]] val bottom = periods[anchor.bottom[columnNum]] column.subList( top.positionInColumn, bottom.positionInColumn ).forEach { val view = findViewByPosition(it.adapterPosition)?: return if (getDecoratedBottom(view) >= parentTop) return removeAndRecycleView(view, recycler) val belowPosition = column[it.positionInColumn + 1] .adapterPosition anchor.top.put(columnNum, belowPosition) } } ը໘͔ΒͰͨDIJMEWJFXͷ࡟আ
  57. (anchor.leftColumn..anchor.rightColumn) .forEach { columnNum -> val column = columns[columnNum] val

    top = periods[anchor.top[columnNum]] val bottom = periods[anchor.bottom[columnNum]] column.subList( top.positionInColumn, bottom.positionInColumn ).forEach { val view = findViewByPosition(it.adapterPosition)?: return if (getDecoratedBottom(view) >= parentTop) return removeAndRecycleView(view, recycler) val belowPosition = column[it.positionInColumn + 1] .adapterPosition anchor.top.put(columnNum, belowPosition) } } ը໘͔ΒͰͨDIJMEWJFXͷ࡟আ
  58. anchor.bottom.forEach { columnNum, position -> val view = findViewByPosition(position) ?:

    return@forEach val bottom = getDecoratedBottom(view) if (bottom < parentBottom) { val left = getDecoratedLeft(view) val period = periods.getOrNull(position) ?: return@forEach val nextPeriod = columns.get(columnNum) .getOrNull(period.positionInColumn + 1) ?: return@forEach addPeriodsToColumn(nextPeriod, left, bottom, true, recycler) } } ۭ͖εϖʔεʹWJFXΛ௥Ճ
  59. anchor.bottom.forEach { columnNum, position -> val view = findViewByPosition(position) ?:

    return@forEach val bottom = getDecoratedBottom(view) if (bottom < parentBottom) { val left = getDecoratedLeft(view) val period = periods.getOrNull(position) ?: return@forEach val nextPeriod = columns.get(columnNum) .getOrNull(period.positionInColumn + 1) ?: return@forEach addPeriodsToColumn(nextPeriod, left, bottom, true, recycler) } } ۭ͖εϖʔεʹWJFXΛ௥Ճ
  60. anchor.bottom.forEach { columnNum, position -> val view = findViewByPosition(position) ?:

    return@forEach val bottom = getDecoratedBottom(view) if (bottom < parentBottom) { val left = getDecoratedLeft(view) val period = periods.getOrNull(position) ?: return@forEach val nextPeriod = columns.get(columnNum) .getOrNull(period.positionInColumn + 1) ?: return@forEach addPeriodsToColumn(nextPeriod, left, bottom, true, recycler) } } ۭ͖εϖʔεʹWJFXΛ௥Ճ
  61. anchor.bottom.forEach { columnNum, position -> val view = findViewByPosition(position) ?:

    return@forEach val bottom = getDecoratedBottom(view) if (bottom < parentBottom) { val left = getDecoratedLeft(view) val period = periods.getOrNull(position) ?: return@forEach val nextPeriod = columns.get(columnNum) .getOrNull(period.positionInColumn + 1) ?: return@forEach addPeriodsToColumn(nextPeriod, left, bottom, true, recycler) } } ۭ͖εϖʔεʹWJFXΛ௥Ճ
  62. 5JNFUBCMF-BZPVU.BOBHFSͷ࣮૷ ͜Μͳײ͡ʹͻͨ͢ΒੵΈ໦Λ͍ͯ͘͠ɻ

  63. ·ͱΊ

  64. ‣ 3FDZDMFS7JFX͍ͧ͢͝ ‣ -BZPVU.BOBHFS͍ͧ͢͝ ‣ -BZPVU.BOBHFSେมͩͧ ‣ ΞϓϦͷཁ݅ʹΑͬͯ͸ଟগΒͩͧ͘ ·ͱΊ