Skip to content

Commit

Permalink
Dev (#4)
Browse files Browse the repository at this point in the history
* Remove extra import

* Fix TimelineDecorator offset calculations (#3)
  • Loading branch information
lriccardo authored Dec 12, 2021
1 parent f14aa67 commit 389fd03
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package com.lriccardo.timelineview

import androidx.annotation.ColorInt

interface TimelineAdapter {
fun getTimelineViewType(position: Int): TimelineView.ViewType? = null
fun getIndicatorStyle(position: Int): TimelineView.IndicatorStyle? = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ class TimelineDecorator(
s: RecyclerView.State
) {
val size = when(indicatorStyle){
TimelineView.IndicatorStyle.Filled -> indicatorSize*2
TimelineView.IndicatorStyle.Empty -> (indicatorSize*2) + checkedIndicatorStrokeWidth
TimelineView.IndicatorStyle.Checked -> (indicatorSize*2) + checkedIndicatorStrokeWidth
TimelineView.IndicatorStyle.Filled -> width
TimelineView.IndicatorStyle.Empty -> width + checkedIndicatorStrokeWidth
TimelineView.IndicatorStyle.Checked -> width + checkedIndicatorStrokeWidth
}.toInt()

when (position) {
Expand Down

0 comments on commit 389fd03

Please sign in to comment.