properly display week number at the monthly widget

This commit is contained in:
tibbi 2017-01-25 19:27:38 +01:00
parent 668a298321
commit 885b2c8654
2 changed files with 2 additions and 2 deletions

View File

@ -149,7 +149,7 @@ class WidgetMonthlyConfigureActivity : AppCompatActivity(), MonthlyCalendar {
for (i in 0..5) {
(findViewById(mRes.getIdentifier("week_num_$i", "id", mPackageName)) as TextView).apply {
text = "${mDays!![i * 7].weekOfYear}:"
text = "${mDays!![i * 7 + 3].weekOfYear}:"
setTextColor(mWeakTextColor)
visibility = View.VISIBLE
}

View File

@ -116,7 +116,7 @@ class MyWidgetMonthlyProvider : AppWidgetProvider(), MonthlyCalendar {
for (i in 0..5) {
val id = mRes.getIdentifier("week_num_$i", "id", packageName)
mRemoteViews.apply {
setTextViewText(id, days[i * 7].weekOfYear.toString() + ":")
setTextViewText(id, days[i * 7 + 3].weekOfYear.toString() + ":")
setInt(id, "setTextColor", mWeakTextColor)
setViewVisibility(id, if (displayWeekNumbers) View.VISIBLE else View.GONE)
}