formatting some files, no real change

This commit is contained in:
tibbi 2020-05-04 22:41:34 +02:00
parent afcb9825b3
commit 42230c5639
5 changed files with 109 additions and 109 deletions

View File

@ -302,7 +302,7 @@ class EventActivity : SimpleActivity() {
mRepeatLimit = getLong(REPEAT_LIMIT) mRepeatLimit = getLong(REPEAT_LIMIT)
mAttendees = Gson().fromJson<ArrayList<Attendee>>(getString(ATTENDEES), object : TypeToken<List<Attendee>>() {}.type) mAttendees = Gson().fromJson<ArrayList<Attendee>>(getString(ATTENDEES), object : TypeToken<List<Attendee>>() {}.type)
?: ArrayList() ?: ArrayList()
mEventTypeId = getLong(EVENT_TYPE_ID) mEventTypeId = getLong(EVENT_TYPE_ID)
mEventCalendarId = getInt(EVENT_CALENDAR_ID) mEventCalendarId = getInt(EVENT_CALENDAR_ID)
@ -732,8 +732,8 @@ class EventActivity : SimpleActivity() {
private fun showReminderTypePicker(currentValue: Int, callback: (Int) -> Unit) { private fun showReminderTypePicker(currentValue: Int, callback: (Int) -> Unit) {
val items = arrayListOf( val items = arrayListOf(
RadioItem(REMINDER_NOTIFICATION, getString(R.string.notification)), RadioItem(REMINDER_NOTIFICATION, getString(R.string.notification)),
RadioItem(REMINDER_EMAIL, getString(R.string.email)) RadioItem(REMINDER_EMAIL, getString(R.string.email))
) )
RadioGroupDialog(this, items, currentValue) { RadioGroupDialog(this, items, currentValue) {
callback(it as Int) callback(it as Int)
@ -809,7 +809,7 @@ class EventActivity : SimpleActivity() {
private fun getCalendarId() = if (mEvent.source == SOURCE_SIMPLE_CALENDAR) config.lastUsedCaldavCalendarId else mEvent.getCalDAVCalendarId() private fun getCalendarId() = if (mEvent.source == SOURCE_SIMPLE_CALENDAR) config.lastUsedCaldavCalendarId else mEvent.getCalDAVCalendarId()
private fun getCalendarWithId(calendars: List<CalDAVCalendar>, calendarId: Int): CalDAVCalendar? = private fun getCalendarWithId(calendars: List<CalDAVCalendar>, calendarId: Int): CalDAVCalendar? =
calendars.firstOrNull { it.id == calendarId } calendars.firstOrNull { it.id == calendarId }
private fun updateCurrentCalendarInfo(currentCalendar: CalDAVCalendar?) { private fun updateCurrentCalendarInfo(currentCalendar: CalDAVCalendar?) {
event_type_image.beVisibleIf(currentCalendar == null) event_type_image.beVisibleIf(currentCalendar == null)
@ -852,8 +852,8 @@ class EventActivity : SimpleActivity() {
private fun resetTime() { private fun resetTime() {
if (mEventEndDateTime.isBefore(mEventStartDateTime) && if (mEventEndDateTime.isBefore(mEventStartDateTime) &&
mEventStartDateTime.dayOfMonth() == mEventEndDateTime.dayOfMonth() && mEventStartDateTime.dayOfMonth() == mEventEndDateTime.dayOfMonth() &&
mEventStartDateTime.monthOfYear() == mEventEndDateTime.monthOfYear()) { mEventStartDateTime.monthOfYear() == mEventEndDateTime.monthOfYear()) {
mEventEndDateTime = mEventEndDateTime.withTime(mEventStartDateTime.hourOfDay, mEventStartDateTime.minuteOfHour, mEventStartDateTime.secondOfMinute, 0) mEventEndDateTime = mEventEndDateTime.withTime(mEventStartDateTime.hourOfDay, mEventStartDateTime.minuteOfHour, mEventStartDateTime.secondOfMinute, 0)
updateEndTimeText() updateEndTimeText()
@ -960,9 +960,9 @@ class EventActivity : SimpleActivity() {
} }
var reminders = arrayListOf( var reminders = arrayListOf(
Reminder(mReminder1Minutes, mReminder1Type), Reminder(mReminder1Minutes, mReminder1Type),
Reminder(mReminder2Minutes, mReminder2Type), Reminder(mReminder2Minutes, mReminder2Type),
Reminder(mReminder3Minutes, mReminder3Type) Reminder(mReminder3Minutes, mReminder3Type)
) )
reminders = reminders.filter { it.minutes != REMINDER_OFF }.sortedBy { it.minutes }.toMutableList() as ArrayList<Reminder> reminders = reminders.filter { it.minutes != REMINDER_OFF }.sortedBy { it.minutes }.toMutableList() as ArrayList<Reminder>
@ -1137,7 +1137,7 @@ class EventActivity : SimpleActivity() {
hideKeyboard() hideKeyboard()
config.backgroundColor.getContrastColor() config.backgroundColor.getContrastColor()
val datepicker = DatePickerDialog(this, mDialogTheme, startDateSetListener, mEventStartDateTime.year, mEventStartDateTime.monthOfYear - 1, val datepicker = DatePickerDialog(this, mDialogTheme, startDateSetListener, mEventStartDateTime.year, mEventStartDateTime.monthOfYear - 1,
mEventStartDateTime.dayOfMonth) mEventStartDateTime.dayOfMonth)
datepicker.datePicker.firstDayOfWeek = if (config.isSundayFirst) Calendar.SUNDAY else Calendar.MONDAY datepicker.datePicker.firstDayOfWeek = if (config.isSundayFirst) Calendar.SUNDAY else Calendar.MONDAY
datepicker.show() datepicker.show()
@ -1151,7 +1151,7 @@ class EventActivity : SimpleActivity() {
private fun setupEndDate() { private fun setupEndDate() {
hideKeyboard() hideKeyboard()
val datepicker = DatePickerDialog(this, mDialogTheme, endDateSetListener, mEventEndDateTime.year, mEventEndDateTime.monthOfYear - 1, val datepicker = DatePickerDialog(this, mDialogTheme, endDateSetListener, mEventEndDateTime.year, mEventEndDateTime.monthOfYear - 1,
mEventEndDateTime.dayOfMonth) mEventEndDateTime.dayOfMonth)
datepicker.datePicker.firstDayOfWeek = if (config.isSundayFirst) Calendar.SUNDAY else Calendar.MONDAY datepicker.datePicker.firstDayOfWeek = if (config.isSundayFirst) Calendar.SUNDAY else Calendar.MONDAY
datepicker.show() datepicker.show()
@ -1373,9 +1373,9 @@ class EventActivity : SimpleActivity() {
if (attendee.isMe) { if (attendee.isMe) {
event_contact_attendee.setOnClickListener { event_contact_attendee.setOnClickListener {
val items = arrayListOf( val items = arrayListOf(
RadioItem(Attendees.ATTENDEE_STATUS_ACCEPTED, getString(R.string.going)), RadioItem(Attendees.ATTENDEE_STATUS_ACCEPTED, getString(R.string.going)),
RadioItem(Attendees.ATTENDEE_STATUS_DECLINED, getString(R.string.not_going)), RadioItem(Attendees.ATTENDEE_STATUS_DECLINED, getString(R.string.not_going)),
RadioItem(Attendees.ATTENDEE_STATUS_TENTATIVE, getString(R.string.maybe_going)) RadioItem(Attendees.ATTENDEE_STATUS_TENTATIVE, getString(R.string.maybe_going))
) )
RadioGroupDialog(this@EventActivity, items, attendee.status) { RadioGroupDialog(this@EventActivity, items, attendee.status) {
@ -1448,13 +1448,13 @@ class EventActivity : SimpleActivity() {
val contacts = ArrayList<Attendee>() val contacts = ArrayList<Attendee>()
val uri = Data.CONTENT_URI val uri = Data.CONTENT_URI
val projection = arrayOf( val projection = arrayOf(
Data.CONTACT_ID, Data.CONTACT_ID,
StructuredName.PREFIX, StructuredName.PREFIX,
StructuredName.GIVEN_NAME, StructuredName.GIVEN_NAME,
StructuredName.MIDDLE_NAME, StructuredName.MIDDLE_NAME,
StructuredName.FAMILY_NAME, StructuredName.FAMILY_NAME,
StructuredName.SUFFIX, StructuredName.SUFFIX,
StructuredName.PHOTO_THUMBNAIL_URI) StructuredName.PHOTO_THUMBNAIL_URI)
val selection = "${Data.MIMETYPE} = ?" val selection = "${Data.MIMETYPE} = ?"
val selectionArgs = arrayOf(StructuredName.CONTENT_ITEM_TYPE) val selectionArgs = arrayOf(StructuredName.CONTENT_ITEM_TYPE)
@ -1482,8 +1482,8 @@ class EventActivity : SimpleActivity() {
val contacts = ArrayList<Attendee>() val contacts = ArrayList<Attendee>()
val uri = CommonDataKinds.Email.CONTENT_URI val uri = CommonDataKinds.Email.CONTENT_URI
val projection = arrayOf( val projection = arrayOf(
Data.CONTACT_ID, Data.CONTACT_ID,
CommonDataKinds.Email.DATA CommonDataKinds.Email.DATA
) )
queryCursor(uri, projection) { cursor -> queryCursor(uri, projection) { cursor ->
@ -1500,7 +1500,7 @@ class EventActivity : SimpleActivity() {
event_show_on_map.applyColorFilter(getAdjustedPrimaryColor()) event_show_on_map.applyColorFilter(getAdjustedPrimaryColor())
val textColor = config.textColor val textColor = config.textColor
arrayOf(event_time_image, event_time_zone_image, event_repetition_image, event_reminder_image, event_type_image, event_caldav_calendar_image, arrayOf(event_time_image, event_time_zone_image, event_repetition_image, event_reminder_image, event_type_image, event_caldav_calendar_image,
event_reminder_1_type, event_reminder_2_type, event_reminder_3_type, event_attendees_image).forEach { event_reminder_1_type, event_reminder_2_type, event_reminder_3_type, event_attendees_image).forEach {
it.applyColorFilter(textColor) it.applyColorFilter(textColor)
} }
} }

View File

@ -126,7 +126,7 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
if (mStoredTextColor != config.textColor || mStoredBackgroundColor != config.backgroundColor || mStoredPrimaryColor != config.primaryColor if (mStoredTextColor != config.textColor || mStoredBackgroundColor != config.backgroundColor || mStoredPrimaryColor != config.primaryColor
|| mStoredDayCode != Formatter.getTodayCode() || mStoredDimPastEvents != config.dimPastEvents) { || mStoredDayCode != Formatter.getTodayCode() || mStoredDimPastEvents != config.dimPastEvents) {
updateViewPager() updateViewPager()
} }
@ -329,11 +329,11 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
val intent = Intent(this, SplashActivity::class.java) val intent = Intent(this, SplashActivity::class.java)
intent.action = SHORTCUT_NEW_EVENT intent.action = SHORTCUT_NEW_EVENT
val shortcut = ShortcutInfo.Builder(this, "new_event") val shortcut = ShortcutInfo.Builder(this, "new_event")
.setShortLabel(newEvent) .setShortLabel(newEvent)
.setLongLabel(newEvent) .setLongLabel(newEvent)
.setIcon(Icon.createWithBitmap(bmp)) .setIcon(Icon.createWithBitmap(bmp))
.setIntent(intent) .setIntent(intent)
.build() .build()
try { try {
manager.dynamicShortcuts = Arrays.asList(shortcut) manager.dynamicShortcuts = Arrays.asList(shortcut)
@ -407,11 +407,11 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
private fun showViewDialog() { private fun showViewDialog() {
val items = arrayListOf( val items = arrayListOf(
RadioItem(DAILY_VIEW, getString(R.string.daily_view)), RadioItem(DAILY_VIEW, getString(R.string.daily_view)),
RadioItem(WEEKLY_VIEW, getString(R.string.weekly_view)), RadioItem(WEEKLY_VIEW, getString(R.string.weekly_view)),
RadioItem(MONTHLY_VIEW, getString(R.string.monthly_view)), RadioItem(MONTHLY_VIEW, getString(R.string.monthly_view)),
RadioItem(YEARLY_VIEW, getString(R.string.yearly_view)), RadioItem(YEARLY_VIEW, getString(R.string.yearly_view)),
RadioItem(EVENTS_LIST_VIEW, getString(R.string.simple_event_list))) RadioItem(EVENTS_LIST_VIEW, getString(R.string.simple_event_list)))
RadioGroupDialog(this, items, config.storedView) { RadioGroupDialog(this, items, config.storedView) {
calendar_fab.beVisibleIf(it as Int != YEARLY_VIEW) calendar_fab.beVisibleIf(it as Int != YEARLY_VIEW)
@ -558,9 +558,9 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
var eventsFound = 0 var eventsFound = 0
val uri = Data.CONTENT_URI val uri = Data.CONTENT_URI
val projection = arrayOf(Contacts.DISPLAY_NAME, val projection = arrayOf(Contacts.DISPLAY_NAME,
CommonDataKinds.Event.CONTACT_ID, CommonDataKinds.Event.CONTACT_ID,
CommonDataKinds.Event.CONTACT_LAST_UPDATED_TIMESTAMP, CommonDataKinds.Event.CONTACT_LAST_UPDATED_TIMESTAMP,
CommonDataKinds.Event.START_DATE) CommonDataKinds.Event.START_DATE)
val selection = "${Data.MIMETYPE} = ? AND ${CommonDataKinds.Event.TYPE} = ?" val selection = "${Data.MIMETYPE} = ? AND ${CommonDataKinds.Event.TYPE} = ?"
val type = if (birthdays) CommonDataKinds.Event.TYPE_BIRTHDAY else CommonDataKinds.Event.TYPE_ANNIVERSARY val type = if (birthdays) CommonDataKinds.Event.TYPE_BIRTHDAY else CommonDataKinds.Event.TYPE_ANNIVERSARY
@ -592,8 +592,8 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
val source = if (birthdays) SOURCE_CONTACT_BIRTHDAY else SOURCE_CONTACT_ANNIVERSARY val source = if (birthdays) SOURCE_CONTACT_BIRTHDAY else SOURCE_CONTACT_ANNIVERSARY
val lastUpdated = cursor.getLongValue(CommonDataKinds.Event.CONTACT_LAST_UPDATED_TIMESTAMP) val lastUpdated = cursor.getLongValue(CommonDataKinds.Event.CONTACT_LAST_UPDATED_TIMESTAMP)
val event = Event(null, timestamp, timestamp, name, reminder1Minutes = reminders[0], reminder2Minutes = reminders[1], val event = Event(null, timestamp, timestamp, name, reminder1Minutes = reminders[0], reminder2Minutes = reminders[1],
reminder3Minutes = reminders[2], importId = contactId, timeZone = DateTimeZone.getDefault().id, flags = FLAG_ALL_DAY, reminder3Minutes = reminders[2], importId = contactId, timeZone = DateTimeZone.getDefault().id, flags = FLAG_ALL_DAY,
repeatInterval = YEAR, repeatRule = REPEAT_SAME_DAY, eventType = eventTypeId, source = source, lastUpdated = lastUpdated) repeatInterval = YEAR, repeatRule = REPEAT_SAME_DAY, eventType = eventTypeId, source = source, lastUpdated = lastUpdated)
val importIDsToDelete = ArrayList<String>() val importIDsToDelete = ArrayList<String>()
for ((key, value) in importIDs) { for ((key, value) in importIDs) {
@ -846,15 +846,15 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
val licenses = LICENSE_JODA val licenses = LICENSE_JODA
val faqItems = arrayListOf( val faqItems = arrayListOf(
FAQItem(R.string.faq_1_title_commons, R.string.faq_1_text_commons), FAQItem(R.string.faq_1_title_commons, R.string.faq_1_text_commons),
FAQItem(R.string.faq_4_title_commons, R.string.faq_4_text_commons), FAQItem(R.string.faq_4_title_commons, R.string.faq_4_text_commons),
FAQItem(R.string.faq_1_title, R.string.faq_1_text), FAQItem(R.string.faq_1_title, R.string.faq_1_text),
FAQItem(R.string.faq_2_title, R.string.faq_2_text), FAQItem(R.string.faq_2_title, R.string.faq_2_text),
FAQItem(R.string.faq_3_title, R.string.faq_3_text), FAQItem(R.string.faq_3_title, R.string.faq_3_text),
FAQItem(R.string.faq_4_title, R.string.faq_4_text), FAQItem(R.string.faq_4_title, R.string.faq_4_text),
FAQItem(R.string.faq_2_title_commons, R.string.faq_2_text_commons), FAQItem(R.string.faq_2_title_commons, R.string.faq_2_text_commons),
FAQItem(R.string.faq_6_title_commons, R.string.faq_6_text_commons), FAQItem(R.string.faq_6_title_commons, R.string.faq_6_text_commons),
FAQItem(R.string.faq_7_title_commons, R.string.faq_7_text_commons)) FAQItem(R.string.faq_7_title_commons, R.string.faq_7_text_commons))
startAboutActivity(R.string.app_name, licenses, BuildConfig.VERSION_NAME, faqItems, true) startAboutActivity(R.string.app_name, licenses, BuildConfig.VERSION_NAME, faqItems, true)
} }

View File

@ -126,7 +126,7 @@ class SettingsActivity : SimpleActivity() {
private fun setupSectionColors() { private fun setupSectionColors() {
val adjustedPrimaryColor = getAdjustedPrimaryColor() val adjustedPrimaryColor = getAdjustedPrimaryColor()
arrayListOf(reminders_label, caldav_label, weekly_view_label, monthly_view_label, simple_event_list_label, widgets_label, events_label, arrayListOf(reminders_label, caldav_label, weekly_view_label, monthly_view_label, simple_event_list_label, widgets_label, events_label,
new_events_label, migrating_label).forEach { new_events_label, migrating_label).forEach {
it.setTextColor(adjustedPrimaryColor) it.setTextColor(adjustedPrimaryColor)
} }
} }
@ -325,16 +325,16 @@ class SettingsActivity : SimpleActivity() {
settings_reminder_sound_holder.setOnClickListener { settings_reminder_sound_holder.setOnClickListener {
SelectAlarmSoundDialog(this, config.reminderSoundUri, config.reminderAudioStream, GET_RINGTONE_URI, ALARM_SOUND_TYPE_NOTIFICATION, false, SelectAlarmSoundDialog(this, config.reminderSoundUri, config.reminderAudioStream, GET_RINGTONE_URI, ALARM_SOUND_TYPE_NOTIFICATION, false,
onAlarmPicked = { onAlarmPicked = {
if (it != null) { if (it != null) {
updateReminderSound(it) updateReminderSound(it)
} }
}, onAlarmSoundDeleted = { }, onAlarmSoundDeleted = {
if (it.uri == config.reminderSoundUri) { if (it.uri == config.reminderSoundUri) {
val defaultAlarm = getDefaultAlarmSound(ALARM_SOUND_TYPE_NOTIFICATION) val defaultAlarm = getDefaultAlarmSound(ALARM_SOUND_TYPE_NOTIFICATION)
updateReminderSound(defaultAlarm) updateReminderSound(defaultAlarm)
} }
}) })
} }
} }
@ -348,10 +348,10 @@ class SettingsActivity : SimpleActivity() {
settings_reminder_audio_stream.text = getAudioStreamText() settings_reminder_audio_stream.text = getAudioStreamText()
settings_reminder_audio_stream_holder.setOnClickListener { settings_reminder_audio_stream_holder.setOnClickListener {
val items = arrayListOf( val items = arrayListOf(
RadioItem(AudioManager.STREAM_ALARM, getString(R.string.alarm_stream)), RadioItem(AudioManager.STREAM_ALARM, getString(R.string.alarm_stream)),
RadioItem(AudioManager.STREAM_SYSTEM, getString(R.string.system_stream)), RadioItem(AudioManager.STREAM_SYSTEM, getString(R.string.system_stream)),
RadioItem(AudioManager.STREAM_NOTIFICATION, getString(R.string.notification_stream)), RadioItem(AudioManager.STREAM_NOTIFICATION, getString(R.string.notification_stream)),
RadioItem(AudioManager.STREAM_RING, getString(R.string.ring_stream))) RadioItem(AudioManager.STREAM_RING, getString(R.string.ring_stream)))
RadioGroupDialog(this@SettingsActivity, items, config.reminderAudioStream) { RadioGroupDialog(this@SettingsActivity, items, config.reminderAudioStream) {
config.reminderAudioStream = it as Int config.reminderAudioStream = it as Int
@ -484,10 +484,10 @@ class SettingsActivity : SimpleActivity() {
settings_font_size.text = getFontSizeText() settings_font_size.text = getFontSizeText()
settings_font_size_holder.setOnClickListener { settings_font_size_holder.setOnClickListener {
val items = arrayListOf( val items = arrayListOf(
RadioItem(FONT_SIZE_SMALL, getString(R.string.small)), RadioItem(FONT_SIZE_SMALL, getString(R.string.small)),
RadioItem(FONT_SIZE_MEDIUM, getString(R.string.medium)), RadioItem(FONT_SIZE_MEDIUM, getString(R.string.medium)),
RadioItem(FONT_SIZE_LARGE, getString(R.string.large)), RadioItem(FONT_SIZE_LARGE, getString(R.string.large)),
RadioItem(FONT_SIZE_EXTRA_LARGE, getString(R.string.extra_large))) RadioItem(FONT_SIZE_EXTRA_LARGE, getString(R.string.extra_large)))
RadioGroupDialog(this@SettingsActivity, items, config.fontSize) { RadioGroupDialog(this@SettingsActivity, items, config.fontSize) {
config.fontSize = it as Int config.fontSize = it as Int
@ -510,12 +510,12 @@ class SettingsActivity : SimpleActivity() {
settings_list_widget_view_to_open.text = getDefaultViewText() settings_list_widget_view_to_open.text = getDefaultViewText()
settings_list_widget_view_to_open_holder.setOnClickListener { settings_list_widget_view_to_open_holder.setOnClickListener {
val items = arrayListOf( val items = arrayListOf(
RadioItem(DAILY_VIEW, getString(R.string.daily_view)), RadioItem(DAILY_VIEW, getString(R.string.daily_view)),
RadioItem(WEEKLY_VIEW, getString(R.string.weekly_view)), RadioItem(WEEKLY_VIEW, getString(R.string.weekly_view)),
RadioItem(MONTHLY_VIEW, getString(R.string.monthly_view)), RadioItem(MONTHLY_VIEW, getString(R.string.monthly_view)),
RadioItem(YEARLY_VIEW, getString(R.string.yearly_view)), RadioItem(YEARLY_VIEW, getString(R.string.yearly_view)),
RadioItem(EVENTS_LIST_VIEW, getString(R.string.simple_event_list)), RadioItem(EVENTS_LIST_VIEW, getString(R.string.simple_event_list)),
RadioItem(LAST_VIEW, getString(R.string.last_view))) RadioItem(LAST_VIEW, getString(R.string.last_view)))
RadioGroupDialog(this@SettingsActivity, items, config.listWidgetViewToOpen) { RadioGroupDialog(this@SettingsActivity, items, config.listWidgetViewToOpen) {
config.listWidgetViewToOpen = it as Int config.listWidgetViewToOpen = it as Int

View File

@ -16,25 +16,25 @@ open class SimpleActivity : BaseSimpleActivity() {
var calDAVRefreshCallback: (() -> Unit)? = null var calDAVRefreshCallback: (() -> Unit)? = null
override fun getAppIconIDs() = arrayListOf( override fun getAppIconIDs() = arrayListOf(
R.mipmap.ic_launcher_red, R.mipmap.ic_launcher_red,
R.mipmap.ic_launcher_pink, R.mipmap.ic_launcher_pink,
R.mipmap.ic_launcher_purple, R.mipmap.ic_launcher_purple,
R.mipmap.ic_launcher_deep_purple, R.mipmap.ic_launcher_deep_purple,
R.mipmap.ic_launcher_indigo, R.mipmap.ic_launcher_indigo,
R.mipmap.ic_launcher_blue, R.mipmap.ic_launcher_blue,
R.mipmap.ic_launcher_light_blue, R.mipmap.ic_launcher_light_blue,
R.mipmap.ic_launcher_cyan, R.mipmap.ic_launcher_cyan,
R.mipmap.ic_launcher_teal, R.mipmap.ic_launcher_teal,
R.mipmap.ic_launcher_green, R.mipmap.ic_launcher_green,
R.mipmap.ic_launcher_light_green, R.mipmap.ic_launcher_light_green,
R.mipmap.ic_launcher_lime, R.mipmap.ic_launcher_lime,
R.mipmap.ic_launcher_yellow, R.mipmap.ic_launcher_yellow,
R.mipmap.ic_launcher_amber, R.mipmap.ic_launcher_amber,
R.mipmap.ic_launcher, R.mipmap.ic_launcher,
R.mipmap.ic_launcher_deep_orange, R.mipmap.ic_launcher_deep_orange,
R.mipmap.ic_launcher_brown, R.mipmap.ic_launcher_brown,
R.mipmap.ic_launcher_blue_grey, R.mipmap.ic_launcher_blue_grey,
R.mipmap.ic_launcher_grey_black R.mipmap.ic_launcher_grey_black
) )
override fun getAppLauncherName() = getString(R.string.app_launcher_name) override fun getAppLauncherName() = getString(R.string.app_launcher_name)

View File

@ -246,10 +246,10 @@ fun Context.getNotification(pendingIntent: PendingIntent, event: Event, content:
val channelId = "simple_calendar_${config.lastReminderChannel}_${config.reminderAudioStream}_${event.eventType}" val channelId = "simple_calendar_${config.lastReminderChannel}_${config.reminderAudioStream}_${event.eventType}"
if (isOreoPlus()) { if (isOreoPlus()) {
val audioAttributes = AudioAttributes.Builder() val audioAttributes = AudioAttributes.Builder()
.setUsage(AudioAttributes.USAGE_ALARM) .setUsage(AudioAttributes.USAGE_ALARM)
.setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION) .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
.setLegacyStreamType(config.reminderAudioStream) .setLegacyStreamType(config.reminderAudioStream)
.build() .build()
val name = eventTypesDB.getEventTypeWithId(event.eventType)?.getDisplayTitle() val name = eventTypesDB.getEventTypeWithId(event.eventType)?.getDisplayTitle()
val importance = NotificationManager.IMPORTANCE_HIGH val importance = NotificationManager.IMPORTANCE_HIGH
@ -272,17 +272,17 @@ fun Context.getNotification(pendingIntent: PendingIntent, event: Event, content:
val contentText = if (publicVersion) resources.getString(R.string.public_event_notification_text) else content val contentText = if (publicVersion) resources.getString(R.string.public_event_notification_text) else content
val builder = NotificationCompat.Builder(this, channelId) val builder = NotificationCompat.Builder(this, channelId)
.setContentTitle(contentTitle) .setContentTitle(contentTitle)
.setContentText(contentText) .setContentText(contentText)
.setSmallIcon(R.drawable.ic_calendar_vector) .setSmallIcon(R.drawable.ic_calendar_vector)
.setContentIntent(pendingIntent) .setContentIntent(pendingIntent)
.setPriority(NotificationCompat.PRIORITY_MAX) .setPriority(NotificationCompat.PRIORITY_MAX)
.setDefaults(Notification.DEFAULT_LIGHTS) .setDefaults(Notification.DEFAULT_LIGHTS)
.setCategory(Notification.CATEGORY_EVENT) .setCategory(Notification.CATEGORY_EVENT)
.setAutoCancel(true) .setAutoCancel(true)
.setSound(Uri.parse(soundUri), config.reminderAudioStream) .setSound(Uri.parse(soundUri), config.reminderAudioStream)
.setChannelId(channelId) .setChannelId(channelId)
.addAction(R.drawable.ic_snooze_vector, getString(R.string.snooze), getSnoozePendingIntent(this, event)) .addAction(R.drawable.ic_snooze_vector, getString(R.string.snooze), getSnoozePendingIntent(this, event))
if (config.vibrateOnReminder) { if (config.vibrateOnReminder) {
val vibrateArray = LongArray(2) { 500 } val vibrateArray = LongArray(2) { 500 }
@ -413,7 +413,7 @@ fun Context.addDayNumber(rawTextColor: Int, day: DayMonthly, linearLayout: Linea
} }
private fun addTodaysBackground(textView: TextView, res: Resources, dayLabelHeight: Int, primaryColor: Int) = private fun addTodaysBackground(textView: TextView, res: Resources, dayLabelHeight: Int, primaryColor: Int) =
textView.addResizedBackgroundDrawable(res, dayLabelHeight, primaryColor, R.drawable.ic_circle_filled) textView.addResizedBackgroundDrawable(res, dayLabelHeight, primaryColor, R.drawable.ic_circle_filled)
fun Context.addDayEvents(day: DayMonthly, linearLayout: LinearLayout, res: Resources, dividerMargin: Int) { fun Context.addDayEvents(day: DayMonthly, linearLayout: LinearLayout, res: Resources, dividerMargin: Int) {
val eventLayoutParams = LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) val eventLayoutParams = LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)