Skip to content

Commit

Permalink
Fixes #5 highlighting of the current day.
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasschuerg committed Apr 17, 2019
1 parent d74c352 commit 3960d4b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {
defaultConfig {
minSdkVersion 16
targetSdkVersion 28
versionCode 4
versionName "1.4.1"
versionCode 5
versionName "1.4.2"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import de.tobiasschuerg.weekview.util.dipToPixelI
import de.tobiasschuerg.weekview.util.toLocalString
import org.threeten.bp.DayOfWeek
import org.threeten.bp.Duration
import org.threeten.bp.LocalDate
import org.threeten.bp.LocalTime
import org.threeten.bp.format.TextStyle
import org.threeten.bp.temporal.ChronoUnit
import org.threeten.bp.temporal.WeekFields
import java.util.Locale
import kotlin.math.roundToInt

Expand Down Expand Up @@ -125,7 +125,7 @@ internal class WeekBackgroundView constructor(context: Context) : View(context)

private fun Canvas.drawColumnsWithHeaders() {
Log.v(TAG, "Drawing vertical dividers on canvas")
val todayDay: DayOfWeek = WeekFields.of(Locale.getDefault()).firstDayOfWeek
val todayDay: DayOfWeek = LocalDate.now().dayOfWeek
for ((column, dayId) in days.withIndex()) {
drawLeftColumnDivider(column)
drawWeekDayName(dayId, column)
Expand Down Expand Up @@ -191,7 +191,7 @@ internal class WeekBackgroundView constructor(context: Context) : View(context)

override fun onMeasure(widthMeasureSpec: Int, hms: Int) {
val height = topOffsetPx + context.dipToPixelF(getDurationMinutes() * scalingFactor) + paddingBottom
val heightMeasureSpec2 = View.MeasureSpec.makeMeasureSpec(height.roundToInt(), View.MeasureSpec.EXACTLY)
val heightMeasureSpec2 = MeasureSpec.makeMeasureSpec(height.roundToInt(), MeasureSpec.EXACTLY)
super.onMeasure(widthMeasureSpec, heightMeasureSpec2)
}

Expand Down

0 comments on commit 3960d4b

Please sign in to comment.