From 699f4d7780bc1ccff61b98ddb2fdf62636f01039 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 8 Oct 2017 11:14:04 +0200 Subject: [PATCH] minor style update --- .../WidgetMonthlyConfigureActivity.kt | 4 +-- .../calendar/fragments/MonthFragment.kt | 25 +++++++++---------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/WidgetMonthlyConfigureActivity.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/WidgetMonthlyConfigureActivity.kt index 6d48c9ccb..ccb24473f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/WidgetMonthlyConfigureActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/WidgetMonthlyConfigureActivity.kt @@ -166,9 +166,7 @@ class WidgetMonthlyConfigureActivity : AppCompatActivity(), MonthlyCalendar { val day = mDays!![i] removeAllViews() - context.addDayNumber(mTextColor, day, this, dayLabelHeight) { - dayLabelHeight = it - } + context.addDayNumber(mTextColor, day, this, dayLabelHeight) { dayLabelHeight = it } context.addDayEvents(day, this, mRes, dividerMargin) } } diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/fragments/MonthFragment.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/fragments/MonthFragment.kt index b9e21cb5f..cdac73bc5 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/fragments/MonthFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/fragments/MonthFragment.kt @@ -100,22 +100,23 @@ class MonthFragment : Fragment(), MonthlyCalendar { mTextColor = baseColor mPrimaryColor = mConfig.primaryColor - mHolder.apply { - top_left_arrow.drawable.mutate().setColorFilter(mTextColor, PorterDuff.Mode.SRC_ATOP) - top_right_arrow.drawable.mutate().setColorFilter(mTextColor, PorterDuff.Mode.SRC_ATOP) - top_left_arrow.background = null - top_right_arrow.background = null - - top_left_arrow.setOnClickListener { + mHolder.top_left_arrow.apply { + drawable.mutate().setColorFilter(mTextColor, PorterDuff.Mode.SRC_ATOP) + background = null + setOnClickListener { listener?.goLeft() } + } - top_right_arrow.setOnClickListener { + mHolder.top_right_arrow.apply { + drawable.mutate().setColorFilter(mTextColor, PorterDuff.Mode.SRC_ATOP) + background = null + setOnClickListener { listener?.goRight() } - - top_value.setOnClickListener { showMonthDialog() } } + + mHolder.top_value.setOnClickListener { showMonthDialog() } } private fun showMonthDialog() { @@ -182,9 +183,7 @@ class MonthFragment : Fragment(), MonthlyCalendar { setOnClickListener { openDay(day.code) } removeAllViews() - context.addDayNumber(mTextColor, day, this, dayLabelHeight) { - dayLabelHeight = it - } + context.addDayNumber(mTextColor, day, this, dayLabelHeight) { dayLabelHeight = it } context.addDayEvents(day, this, mRes, dividerMargin) } }