Slide 1

Slide 1 text

3FDZDMFS7JFXͰ ંΕઢάϥϑΛ࡞Δ %.."OESPJEษڧձ !BNZV@TBO

Slide 2

Slide 2 text

"CPVUNF w 5XJUUFS!BNZV@TBO w HJUIVCBNZV w 1JDBQQJOD w 5FMMFS

Slide 3

Slide 3 text

"HFOEB w ࡞Γ࢝ΊΔલஔ͖ w ࡞ͬͯΈͨ w ϝϦοτŊσϝϦοτ w ·ͱΊ

Slide 4

Slide 4 text

άϥϑͱݴͬͯࢥ͍ͭ ͘ͷ͕

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

.1"OESPJE$IBSU

Slide 7

Slide 7 text

͘͢͝ྑ͘Ͱ͖ͨ-JCSBSZ Ͱେม͓ੈ࿩ʹͳͬͯ·͢

Slide 8

Slide 8 text

ͨͩŊ࣌ʑσβΠϯ௨ ΓʹͳΒͳ͍͕࣌͋Δ

Slide 9

Slide 9 text

w σβΠφ͞Μʹ.1"OESPJE$IBSUͰͰ͖Δൣғ಺Ͱσβ ΠϯΛม͑ͯ΋Β͏ w σβΠφ͞Μͷظ଴ʹͨ͑͜ΕΔΑ͏ؤுͬͯ࡞Δ

Slide 10

Slide 10 text

w σβΠφ͞Μʹ.1"OESPJE$IBSUͰͰ͖Δൣғ಺Ͱσβ ΠϯΛม͑ͯ΋Β͏ w σβΠφ͞Μͷظ଴ʹͨ͑͜ΕΔΑ͏ؤுͬͯ࡞Δ

Slide 11

Slide 11 text

"HFOEB w ࡞Γ࢝ΊΔલஔ͖ w ࡞ͬͯΈͨ w ϝϦοτŊσϝϦοτ w ·ͱΊ

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

w "EBQUFSͭ w *UFN%FDPSBUJPOͭ

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

"EBQUFS

Slide 16

Slide 16 text

7JFX)PMEFS

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

 

Slide 19

Slide 19 text

 

Slide 20

Slide 20 text

Y ZDBOWBTIFJHIU TUBSU:  YDBOWBTXJEUI ZDBOWBTIFJHIU FOE: 

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

*UFN%FDPSBUJPO

Slide 23

Slide 23 text

abstract class HorizontalDateItemDecoration( private val _context: Context ) : RecyclerView.ItemDecoration(), ViewExtensions { private val height = 64.dp private val textSize = 14f.sp private val backgroundPaint = Paint().apply { color = Color.parseColor("#000000") } private val dayTextPaint = Paint().apply { color = Color.parseColor("#FF00FF") textSize = [email protected] isAntiAlias = true } private val yearAndMonthPaint = Paint().apply { color = Color.parseColor("#FFFF00") textSize = [email protected] isAntiAlias = true } override fun getContext(): Context = _context override fun onDraw( canvas: Canvas, parent: RecyclerView, state: RecyclerView.State ) { canvas.drawRect(0f, 0f, canvas.width.toFloat(), height.toFloat(), backgroundPaint) var isVisibleFirstDay = false var isVisibleLastDay = false var lastVisibleYearAndMonthText = "" var lastVisibleYearAndMonthY = 0f parent.children.forEach { view -> val adapterPosition = parent.getChildAdapterPosition(view) val localDateFromPosition = getDate(adapterPosition) //೔෇ͷඳը val dayText = localDateFromPosition.dayOfMonth.toString() val dayTextSizeRect = getTextSizeRect(dayTextPaint, dayText) val dayTextX = view.x + (view.width - dayTextSizeRect.width()) / 2 val dayTextY = dayTextSizeRect.height().toFloat() + (height / 2 - dayTextSizeRect.height()) / 2 + height / 2 canvas.drawText(dayText, dayTextX, dayTextY, dayTextPaint) //೥݄ͷඳը val yearAndMonthText = "${localDateFromPosition.year}೥${localDateFromPosition.monthValue}݄" val yearAndMonthTextSizeRect = getTextSizeRect(yearAndMonthPaint, yearAndMonthText) val yearAndMonthY = yearAndMonthTextSizeRect.height().toFloat() + (height / 2 - yearAndMonthTextSizeRect.height()) / 2 val isFirstDayOfMonth = localDateFromPosition.isEqual(localDateFromPosition.with(firstDayOfMonth())) val isLastDayOfMonth = localDateFromPosition.isEqual(localDateFromPosition.with(lastDayOfMonth())) when { isFirstDayOfMonth -> { (view.x).let { x -> if (x > 0) { canvas.drawText(yearAndMonthText, x, yearAndMonthY, yearAndMonthPaint) } else { canvas.drawText(yearAndMonthText, 0f, yearAndMonthY, yearAndMonthPaint) } } isVisibleFirstDay = true } isLastDayOfMonth -> { (view.x + view.width - yearAndMonthTextSizeRect.width()).let { x -> if (x < 0) { canvas.drawText(yearAndMonthText, x, yearAndMonthY, yearAndMonthPaint) } else { canvas.drawText(yearAndMonthText, 0f, yearAndMonthY, yearAndMonthPaint) } } isVisibleLastDay = true } } lastVisibleYearAndMonthText = yearAndMonthText lastVisibleYearAndMonthY = yearAndMonthY } //೥݄ͷඳը if (!isVisibleFirstDay && !isVisibleLastDay) { canvas.drawText( lastVisibleYearAndMonthText, 0f, lastVisibleYearAndMonthY, yearAndMonthPaint ) } } override fun getItemOffsets( outRect: Rect, view: View, parent: RecyclerView, state: RecyclerView.State ) { outRect.set(0, height, 0, 0) } abstract fun getDate(position: Int): LocalDate }

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

EQ

Slide 26

Slide 26 text

w "EBQUFS΍7JFX)PMEFS͕໨੝ΓΛඳը͢ΔྖҬͷ͜ͱΛ ߟ͑ͳͯ͘͢Ή

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

"HFOEB w ࡞Γ࢝ΊΔલஔ͖ w ࡞ͬͯΈͨ w ϝϦοτŊσϝϦοτ w ·ͱΊ

Slide 29

Slide 29 text

ϝϦοτ w खͷಧ͘ൣғ಺Ͱϝϯςφϯε͕Ͱ͖Δ w σβΠϯͷमਖ਼͕͠΍͍͢ w ੹຿Λ෼͚Δ͜ͱ͕Ͱ͖Δ w "EBQUFSͱ7JFX)PMEFSΛάϥϑ෦෼ w *UFN%FDPSBUJPOΛॎ࣠Ŋԣ࣠ͷ໨੝ w *UFNͷ$MJDL&WFOUΛϋϯυϦϯά͢Δͷ΋ָ w $BOWBTͰ4DSPMMBCMFͳάϥϑΛ࡞Δͷ͸େม͚ͩͲŊ͜ΕͳΒ؆୯ͩͶ

Slide 30

Slide 30 text

σϝϦοτ w ΍ͬͺΓ࣌ʑݶք͕͋Δ w $BOWBTͰؤுΖ͏

Slide 31

Slide 31 text

"HFOEB w ࡞Γ࢝ΊΔલஔ͖ w ࡞ͬͯΈͨ w ϝϦοτŊσϝϦοτ w ·ͱΊ

Slide 32

Slide 32 text

·ͱΊ w 3FDZDMFS7JFX͸ແݶͷՄೳੑΛײ͡Δ w -BZPVU.BOBHFS࢖͑͹ԁάϥϑ΋Ͱ͖Δ w 3FDZDMFS7JFXΛ4DSPMMͷύϑΥʔϚϯε͕ྑ͘ͳΔΧε λϜ7JFX(SPVQͱͯ͠࢖͍ͬͯ͘ͷ͸ྑ͍બ୒

Slide 33

Slide 33 text

https://github.com/amyu/HorizontalDateItemDecoration/

Slide 34

Slide 34 text

͝ਗ਼ௌ͋Γ͕ͱ͏͟͝ ͍·ͨ͠