minor code style updating + import formatting

This commit is contained in:
Tibor Kaputa 2021-12-25 21:19:32 +01:00 committed by GitHub
parent 7767fdaf62
commit 1b7cd2fc3c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -13,15 +13,20 @@ import com.simplemobiletools.calendar.pro.dialogs.CustomPeriodPickerDialog
import com.simplemobiletools.calendar.pro.extensions.config
import com.simplemobiletools.calendar.pro.extensions.seconds
import com.simplemobiletools.calendar.pro.extensions.widgetsDB
import com.simplemobiletools.calendar.pro.helpers.*
import com.simplemobiletools.calendar.pro.helpers.EVENT_PERIOD_CUSTOM
import com.simplemobiletools.calendar.pro.helpers.EVENT_PERIOD_TODAY
import com.simplemobiletools.calendar.pro.helpers.Formatter
import com.simplemobiletools.calendar.pro.helpers.MyWidgetListProvider
import com.simplemobiletools.calendar.pro.models.ListEvent
import com.simplemobiletools.calendar.pro.models.ListItem
import com.simplemobiletools.calendar.pro.models.ListSectionDay
import com.simplemobiletools.calendar.pro.models.Widget
import com.simplemobiletools.commons.dialogs.ColorPickerDialog
import com.simplemobiletools.commons.dialogs.RadioGroupDialog
import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.extensions.adjustAlpha
import com.simplemobiletools.commons.extensions.applyColorFilter
import com.simplemobiletools.commons.extensions.hideKeyboard
import com.simplemobiletools.commons.extensions.setFillWithStroke
import com.simplemobiletools.commons.helpers.*
import com.simplemobiletools.commons.models.RadioItem
import kotlinx.android.synthetic.main.widget_config_list.*
@ -146,13 +151,11 @@ class WidgetListConfigureActivity : SimpleActivity() {
period_picker_value.setText(R.string.within_the_next_one_year)
}
EVENT_PERIOD_TODAY -> period_picker_value.setText(R.string.today_only)
else -> {
period_picker_value.setText(getFormattedSeconds(selectedPeriodOption))
}
else -> period_picker_value.text = getFormattedSeconds(selectedPeriodOption)
}
}
private fun getFormattedSeconds(seconds: Int): String = if (seconds === EVENT_PERIOD_TODAY) {
private fun getFormattedSeconds(seconds: Int): String = if (seconds == EVENT_PERIOD_TODAY) {
getString(R.string.today_only)
} else {
when {