mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-06-05 21:59:17 +02:00
use the new way of fetching colors
This commit is contained in:
@ -46,7 +46,6 @@ import org.joda.time.DateTime
|
|||||||
import org.joda.time.DateTimeZone
|
import org.joda.time.DateTimeZone
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import java.util.regex.Pattern
|
import java.util.regex.Pattern
|
||||||
import kotlin.collections.ArrayList
|
|
||||||
|
|
||||||
class EventActivity : SimpleActivity() {
|
class EventActivity : SimpleActivity() {
|
||||||
private val LAT_LON_PATTERN = "^[-+]?([1-8]?\\d(\\.\\d+)?|90(\\.0+)?)([,;])\\s*[-+]?(180(\\.0+)?|((1[0-7]\\d)|([1-9]?\\d))(\\.\\d+)?)\$"
|
private val LAT_LON_PATTERN = "^[-+]?([1-8]?\\d(\\.\\d+)?|90(\\.0+)?)([,;])\\s*[-+]?(180(\\.0+)?|((1[0-7]\\d)|([1-9]?\\d))(\\.\\d+)?)\$"
|
||||||
@ -875,13 +874,13 @@ class EventActivity : SimpleActivity() {
|
|||||||
private fun updateReminderTypeImage(view: ImageView, reminder: Reminder) {
|
private fun updateReminderTypeImage(view: ImageView, reminder: Reminder) {
|
||||||
view.beVisibleIf(reminder.minutes != REMINDER_OFF && mEventCalendarId != STORED_LOCALLY_ONLY)
|
view.beVisibleIf(reminder.minutes != REMINDER_OFF && mEventCalendarId != STORED_LOCALLY_ONLY)
|
||||||
val drawable = if (reminder.type == REMINDER_NOTIFICATION) R.drawable.ic_bell_vector else R.drawable.ic_mail_vector
|
val drawable = if (reminder.type == REMINDER_NOTIFICATION) R.drawable.ic_bell_vector else R.drawable.ic_mail_vector
|
||||||
val icon = resources.getColoredDrawableWithColor(drawable, config.textColor)
|
val icon = resources.getColoredDrawableWithColor(drawable, getProperTextColor())
|
||||||
view.setImageDrawable(icon)
|
view.setImageDrawable(icon)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun updateAvailabilityImage() {
|
private fun updateAvailabilityImage() {
|
||||||
val drawable = if (mAvailability == Attendees.AVAILABILITY_FREE) R.drawable.ic_event_available_vector else R.drawable.ic_event_busy_vector
|
val drawable = if (mAvailability == Attendees.AVAILABILITY_FREE) R.drawable.ic_event_available_vector else R.drawable.ic_event_busy_vector
|
||||||
val icon = resources.getColoredDrawableWithColor(drawable, config.textColor)
|
val icon = resources.getColoredDrawableWithColor(drawable, getProperTextColor())
|
||||||
event_availability_image.setImageDrawable(icon)
|
event_availability_image.setImageDrawable(icon)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -899,7 +898,7 @@ class EventActivity : SimpleActivity() {
|
|||||||
if (eventType != null) {
|
if (eventType != null) {
|
||||||
runOnUiThread {
|
runOnUiThread {
|
||||||
event_type.text = eventType.title
|
event_type.text = eventType.title
|
||||||
event_type_color.setFillWithStroke(eventType.color, config.backgroundColor)
|
event_type_color.setFillWithStroke(eventType.color, getProperBackgroundColor())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -967,7 +966,7 @@ class EventActivity : SimpleActivity() {
|
|||||||
val calendarColor = eventsHelper.getEventTypeWithCalDAVCalendarId(currentCalendar.id)?.color ?: currentCalendar.color
|
val calendarColor = eventsHelper.getEventTypeWithCalDAVCalendarId(currentCalendar.id)?.color ?: currentCalendar.color
|
||||||
|
|
||||||
runOnUiThread {
|
runOnUiThread {
|
||||||
event_caldav_calendar_color.setFillWithStroke(calendarColor, config.backgroundColor)
|
event_caldav_calendar_color.setFillWithStroke(calendarColor, getProperBackgroundColor())
|
||||||
event_caldav_calendar_name.apply {
|
event_caldav_calendar_name.apply {
|
||||||
text = currentCalendar.displayName
|
text = currentCalendar.displayName
|
||||||
setPadding(paddingLeft, paddingTop, paddingRight, resources.getDimension(R.dimen.tiny_margin).toInt())
|
setPadding(paddingLeft, paddingTop, paddingRight, resources.getDimension(R.dimen.tiny_margin).toInt())
|
||||||
@ -1276,7 +1275,7 @@ class EventActivity : SimpleActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun checkStartEndValidity() {
|
private fun checkStartEndValidity() {
|
||||||
val textColor = if (mEventStartDateTime.isAfter(mEventEndDateTime)) resources.getColor(R.color.red_text) else config.textColor
|
val textColor = if (mEventStartDateTime.isAfter(mEventEndDateTime)) resources.getColor(R.color.red_text) else getProperTextColor()
|
||||||
event_end_date.setTextColor(textColor)
|
event_end_date.setTextColor(textColor)
|
||||||
event_end_time.setTextColor(textColor)
|
event_end_time.setTextColor(textColor)
|
||||||
}
|
}
|
||||||
@ -1523,7 +1522,8 @@ class EventActivity : SimpleActivity() {
|
|||||||
beVisible()
|
beVisible()
|
||||||
|
|
||||||
val attendeeStatusBackground = resources.getDrawable(R.drawable.attendee_status_circular_background)
|
val attendeeStatusBackground = resources.getDrawable(R.drawable.attendee_status_circular_background)
|
||||||
(attendeeStatusBackground as LayerDrawable).findDrawableByLayerId(R.id.attendee_status_circular_background).applyColorFilter(config.backgroundColor)
|
(attendeeStatusBackground as LayerDrawable).findDrawableByLayerId(R.id.attendee_status_circular_background)
|
||||||
|
.applyColorFilter(getProperBackgroundColor())
|
||||||
event_contact_status_image.apply {
|
event_contact_status_image.apply {
|
||||||
background = attendeeStatusBackground
|
background = attendeeStatusBackground
|
||||||
setImageDrawable(getAttendeeStatusImage(attendee))
|
setImageDrawable(getAttendeeStatusImage(attendee))
|
||||||
@ -1687,7 +1687,7 @@ class EventActivity : SimpleActivity() {
|
|||||||
|
|
||||||
private fun updateIconColors() {
|
private fun updateIconColors() {
|
||||||
event_show_on_map.applyColorFilter(getProperPrimaryColor())
|
event_show_on_map.applyColorFilter(getProperPrimaryColor())
|
||||||
val textColor = config.textColor
|
val textColor = getProperTextColor()
|
||||||
arrayOf(
|
arrayOf(
|
||||||
event_time_image, event_time_zone_image, event_repetition_image, event_reminder_image, event_type_image, event_caldav_calendar_image,
|
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, event_availability_image
|
event_reminder_1_type, event_reminder_2_type, event_reminder_3_type, event_attendees_image, event_availability_image
|
||||||
|
@ -154,7 +154,7 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
|
|||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
super.onResume()
|
super.onResume()
|
||||||
if (mStoredTextColor != config.textColor || mStoredBackgroundColor != config.backgroundColor || mStoredPrimaryColor != getProperPrimaryColor()
|
if (mStoredTextColor != getProperTextColor() || mStoredBackgroundColor != getProperBackgroundColor() || mStoredPrimaryColor != getProperPrimaryColor()
|
||||||
|| mStoredDayCode != Formatter.getTodayCode() || mStoredDimPastEvents != config.dimPastEvents || mStoredHighlightWeekends != config.highlightWeekends
|
|| mStoredDayCode != Formatter.getTodayCode() || mStoredDimPastEvents != config.dimPastEvents || mStoredHighlightWeekends != config.highlightWeekends
|
||||||
|| mStoredHighlightWeekendsColor != config.highlightWeekendsColor
|
|| mStoredHighlightWeekendsColor != config.highlightWeekendsColor
|
||||||
) {
|
) {
|
||||||
@ -179,14 +179,14 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
|
|||||||
storeStateVariables()
|
storeStateVariables()
|
||||||
updateWidgets()
|
updateWidgets()
|
||||||
updateTextColors(calendar_coordinator)
|
updateTextColors(calendar_coordinator)
|
||||||
fab_extended_overlay.background = ColorDrawable(config.backgroundColor.adjustAlpha(0.8f))
|
fab_extended_overlay.background = ColorDrawable(getProperBackgroundColor().adjustAlpha(0.8f))
|
||||||
fab_event_label.setTextColor(config.textColor)
|
fab_event_label.setTextColor(getProperTextColor())
|
||||||
fab_task_label.setTextColor(config.textColor)
|
fab_task_label.setTextColor(getProperTextColor())
|
||||||
|
|
||||||
fab_task_icon.drawable.applyColorFilter(mStoredPrimaryColor.getContrastColor())
|
fab_task_icon.drawable.applyColorFilter(mStoredPrimaryColor.getContrastColor())
|
||||||
fab_task_icon.background.applyColorFilter(mStoredPrimaryColor)
|
fab_task_icon.background.applyColorFilter(mStoredPrimaryColor)
|
||||||
|
|
||||||
search_holder.background = ColorDrawable(config.backgroundColor)
|
search_holder.background = ColorDrawable(getProperBackgroundColor())
|
||||||
checkSwipeRefreshAvailability()
|
checkSwipeRefreshAvailability()
|
||||||
checkShortcuts()
|
checkShortcuts()
|
||||||
|
|
||||||
@ -292,10 +292,11 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun storeStateVariables() {
|
private fun storeStateVariables() {
|
||||||
|
mStoredTextColor = getProperTextColor()
|
||||||
|
mStoredPrimaryColor = getProperPrimaryColor()
|
||||||
|
mStoredBackgroundColor = getProperBackgroundColor()
|
||||||
config.apply {
|
config.apply {
|
||||||
mStoredIsSundayFirst = isSundayFirst
|
mStoredIsSundayFirst = isSundayFirst
|
||||||
mStoredTextColor = textColor
|
|
||||||
mStoredBackgroundColor = backgroundColor
|
|
||||||
mStoredUse24HourFormat = use24HourFormat
|
mStoredUse24HourFormat = use24HourFormat
|
||||||
mStoredDimPastEvents = dimPastEvents
|
mStoredDimPastEvents = dimPastEvents
|
||||||
mStoredHighlightWeekends = highlightWeekends
|
mStoredHighlightWeekends = highlightWeekends
|
||||||
@ -303,7 +304,6 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
|
|||||||
mStoredMidnightSpan = showMidnightSpanningEventsAtTop
|
mStoredMidnightSpan = showMidnightSpanningEventsAtTop
|
||||||
mStoredStartWeekWithCurrentDay = startWeekWithCurrentDay
|
mStoredStartWeekWithCurrentDay = startWeekWithCurrentDay
|
||||||
}
|
}
|
||||||
mStoredPrimaryColor = getProperPrimaryColor()
|
|
||||||
mStoredDayCode = Formatter.getTodayCode()
|
mStoredDayCode = Formatter.getTodayCode()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ class SettingsActivity : SimpleActivity() {
|
|||||||
settings_events_holder,
|
settings_events_holder,
|
||||||
settings_migrating_holder
|
settings_migrating_holder
|
||||||
).forEach {
|
).forEach {
|
||||||
it.background.applyColorFilter(baseConfig.backgroundColor.getContrastColor())
|
it.background.applyColorFilter(getProperBackgroundColor().getContrastColor())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -373,12 +373,12 @@ class SettingsActivity : SimpleActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun setupHighlightWeekendsColor() {
|
private fun setupHighlightWeekendsColor() {
|
||||||
settings_highlight_weekends_color.setFillWithStroke(config.highlightWeekendsColor, config.backgroundColor)
|
settings_highlight_weekends_color.setFillWithStroke(config.highlightWeekendsColor, getProperBackgroundColor())
|
||||||
settings_highlight_weekends_color_holder.setOnClickListener {
|
settings_highlight_weekends_color_holder.setOnClickListener {
|
||||||
ColorPickerDialog(this, config.highlightWeekendsColor) { wasPositivePressed, color ->
|
ColorPickerDialog(this, config.highlightWeekendsColor) { wasPositivePressed, color ->
|
||||||
if (wasPositivePressed) {
|
if (wasPositivePressed) {
|
||||||
config.highlightWeekendsColor = color
|
config.highlightWeekendsColor = color
|
||||||
settings_highlight_weekends_color.setFillWithStroke(color, config.backgroundColor)
|
settings_highlight_weekends_color.setFillWithStroke(color, getProperBackgroundColor())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,12 +18,7 @@ import com.simplemobiletools.calendar.pro.models.Event
|
|||||||
import com.simplemobiletools.commons.dialogs.ConfirmationDialog
|
import com.simplemobiletools.commons.dialogs.ConfirmationDialog
|
||||||
import com.simplemobiletools.commons.extensions.*
|
import com.simplemobiletools.commons.extensions.*
|
||||||
import com.simplemobiletools.commons.helpers.ensureBackgroundThread
|
import com.simplemobiletools.commons.helpers.ensureBackgroundThread
|
||||||
import kotlinx.android.synthetic.main.activity_event.*
|
|
||||||
import kotlinx.android.synthetic.main.activity_task.*
|
import kotlinx.android.synthetic.main.activity_task.*
|
||||||
import kotlinx.android.synthetic.main.activity_task.event_type
|
|
||||||
import kotlinx.android.synthetic.main.activity_task.event_type_color
|
|
||||||
import kotlinx.android.synthetic.main.activity_task.event_type_holder
|
|
||||||
import kotlinx.android.synthetic.main.activity_task.event_type_image
|
|
||||||
import org.joda.time.DateTime
|
import org.joda.time.DateTime
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
@ -282,7 +277,7 @@ class TaskActivity : SimpleActivity() {
|
|||||||
if (mTask.isTaskCompleted()) {
|
if (mTask.isTaskCompleted()) {
|
||||||
toggle_mark_complete.background = ContextCompat.getDrawable(this, R.drawable.button_background_stroke)
|
toggle_mark_complete.background = ContextCompat.getDrawable(this, R.drawable.button_background_stroke)
|
||||||
toggle_mark_complete.setText(R.string.mark_incomplete)
|
toggle_mark_complete.setText(R.string.mark_incomplete)
|
||||||
toggle_mark_complete.setTextColor(config.textColor)
|
toggle_mark_complete.setTextColor(getProperTextColor())
|
||||||
} else {
|
} else {
|
||||||
val markCompleteBgColor = if (isWhiteTheme()) {
|
val markCompleteBgColor = if (isWhiteTheme()) {
|
||||||
Color.WHITE
|
Color.WHITE
|
||||||
@ -321,7 +316,7 @@ class TaskActivity : SimpleActivity() {
|
|||||||
if (eventType != null) {
|
if (eventType != null) {
|
||||||
runOnUiThread {
|
runOnUiThread {
|
||||||
event_type.text = eventType.title
|
event_type.text = eventType.title
|
||||||
event_type_color.setFillWithStroke(eventType.color, config.backgroundColor)
|
event_type_color.setFillWithStroke(eventType.color, getProperBackgroundColor())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -329,7 +324,7 @@ class TaskActivity : SimpleActivity() {
|
|||||||
|
|
||||||
private fun updateColors() {
|
private fun updateColors() {
|
||||||
updateTextColors(task_scrollview)
|
updateTextColors(task_scrollview)
|
||||||
task_time_image.applyColorFilter(config.textColor)
|
task_time_image.applyColorFilter(getProperTextColor())
|
||||||
event_type_image.applyColorFilter(config.textColor)
|
event_type_image.applyColorFilter(getProperTextColor())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,7 @@ import com.simplemobiletools.calendar.pro.helpers.MyWidgetDateProvider
|
|||||||
import com.simplemobiletools.commons.dialogs.ColorPickerDialog
|
import com.simplemobiletools.commons.dialogs.ColorPickerDialog
|
||||||
import com.simplemobiletools.commons.extensions.adjustAlpha
|
import com.simplemobiletools.commons.extensions.adjustAlpha
|
||||||
import com.simplemobiletools.commons.extensions.applyColorFilter
|
import com.simplemobiletools.commons.extensions.applyColorFilter
|
||||||
|
import com.simplemobiletools.commons.extensions.getProperPrimaryColor
|
||||||
import com.simplemobiletools.commons.extensions.setFillWithStroke
|
import com.simplemobiletools.commons.extensions.setFillWithStroke
|
||||||
import com.simplemobiletools.commons.helpers.LOWER_ALPHA
|
import com.simplemobiletools.commons.helpers.LOWER_ALPHA
|
||||||
import kotlinx.android.synthetic.main.widget_config_date.*
|
import kotlinx.android.synthetic.main.widget_config_date.*
|
||||||
@ -113,7 +114,7 @@ class WidgetDateConfigureActivity : SimpleActivity() {
|
|||||||
private fun updateColors() {
|
private fun updateColors() {
|
||||||
mTextColor = mTextColorWithoutTransparency
|
mTextColor = mTextColorWithoutTransparency
|
||||||
mWeakTextColor = mTextColorWithoutTransparency.adjustAlpha(LOWER_ALPHA)
|
mWeakTextColor = mTextColorWithoutTransparency.adjustAlpha(LOWER_ALPHA)
|
||||||
mPrimaryColor = config.primaryColor
|
mPrimaryColor = getProperPrimaryColor()
|
||||||
|
|
||||||
config_text_color.setFillWithStroke(mTextColor, Color.BLACK)
|
config_text_color.setFillWithStroke(mTextColor, Color.BLACK)
|
||||||
config_save.setTextColor(mTextColor)
|
config_save.setTextColor(mTextColor)
|
||||||
|
@ -13,8 +13,10 @@ import com.simplemobiletools.calendar.pro.dialogs.CustomPeriodPickerDialog
|
|||||||
import com.simplemobiletools.calendar.pro.extensions.config
|
import com.simplemobiletools.calendar.pro.extensions.config
|
||||||
import com.simplemobiletools.calendar.pro.extensions.seconds
|
import com.simplemobiletools.calendar.pro.extensions.seconds
|
||||||
import com.simplemobiletools.calendar.pro.extensions.widgetsDB
|
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.Formatter
|
||||||
|
import com.simplemobiletools.calendar.pro.helpers.MyWidgetListProvider
|
||||||
import com.simplemobiletools.calendar.pro.models.ListEvent
|
import com.simplemobiletools.calendar.pro.models.ListEvent
|
||||||
import com.simplemobiletools.calendar.pro.models.ListItem
|
import com.simplemobiletools.calendar.pro.models.ListItem
|
||||||
import com.simplemobiletools.calendar.pro.models.ListSectionDay
|
import com.simplemobiletools.calendar.pro.models.ListSectionDay
|
||||||
@ -56,7 +58,7 @@ class WidgetListConfigureActivity : SimpleActivity() {
|
|||||||
config_events_list.adapter = this
|
config_events_list.adapter = this
|
||||||
}
|
}
|
||||||
|
|
||||||
period_picker_holder.background = ColorDrawable(config.backgroundColor)
|
period_picker_holder.background = ColorDrawable(getProperBackgroundColor())
|
||||||
period_picker_value.setOnClickListener { showPeriodSelector() }
|
period_picker_value.setOnClickListener { showPeriodSelector() }
|
||||||
|
|
||||||
config_save.setOnClickListener { saveConfig() }
|
config_save.setOnClickListener { saveConfig() }
|
||||||
@ -65,7 +67,7 @@ class WidgetListConfigureActivity : SimpleActivity() {
|
|||||||
|
|
||||||
period_picker_holder.beGoneIf(isCustomizingColors)
|
period_picker_holder.beGoneIf(isCustomizingColors)
|
||||||
|
|
||||||
val primaryColor = config.primaryColor
|
val primaryColor = getProperPrimaryColor()
|
||||||
config_bg_seekbar.setColors(mTextColor, primaryColor, primaryColor)
|
config_bg_seekbar.setColors(mTextColor, primaryColor, primaryColor)
|
||||||
|
|
||||||
updateSelectedPeriod(config.lastUsedEventSpan)
|
updateSelectedPeriod(config.lastUsedEventSpan)
|
||||||
@ -230,7 +232,7 @@ class WidgetListConfigureActivity : SimpleActivity() {
|
|||||||
getString(R.string.sample_title_1),
|
getString(R.string.sample_title_1),
|
||||||
getString(R.string.sample_description_1),
|
getString(R.string.sample_description_1),
|
||||||
false,
|
false,
|
||||||
config.primaryColor,
|
getProperPrimaryColor(),
|
||||||
"",
|
"",
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
@ -247,7 +249,7 @@ class WidgetListConfigureActivity : SimpleActivity() {
|
|||||||
getString(R.string.sample_title_2),
|
getString(R.string.sample_title_2),
|
||||||
getString(R.string.sample_description_2),
|
getString(R.string.sample_description_2),
|
||||||
false,
|
false,
|
||||||
config.primaryColor,
|
getProperPrimaryColor(),
|
||||||
"",
|
"",
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
@ -270,7 +272,7 @@ class WidgetListConfigureActivity : SimpleActivity() {
|
|||||||
getString(R.string.sample_title_3),
|
getString(R.string.sample_title_3),
|
||||||
"",
|
"",
|
||||||
false,
|
false,
|
||||||
config.primaryColor,
|
getProperPrimaryColor(),
|
||||||
"",
|
"",
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
@ -287,7 +289,7 @@ class WidgetListConfigureActivity : SimpleActivity() {
|
|||||||
getString(R.string.sample_title_4),
|
getString(R.string.sample_title_4),
|
||||||
getString(R.string.sample_description_4),
|
getString(R.string.sample_description_4),
|
||||||
false,
|
false,
|
||||||
config.primaryColor,
|
getProperPrimaryColor(),
|
||||||
"",
|
"",
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
@ -304,7 +306,7 @@ class WidgetListConfigureActivity : SimpleActivity() {
|
|||||||
getString(R.string.sample_title_5),
|
getString(R.string.sample_title_5),
|
||||||
"",
|
"",
|
||||||
false,
|
false,
|
||||||
config.primaryColor,
|
getProperPrimaryColor(),
|
||||||
"",
|
"",
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
|
@ -19,10 +19,7 @@ import com.simplemobiletools.calendar.pro.helpers.isWeekend
|
|||||||
import com.simplemobiletools.calendar.pro.interfaces.MonthlyCalendar
|
import com.simplemobiletools.calendar.pro.interfaces.MonthlyCalendar
|
||||||
import com.simplemobiletools.calendar.pro.models.DayMonthly
|
import com.simplemobiletools.calendar.pro.models.DayMonthly
|
||||||
import com.simplemobiletools.commons.dialogs.ColorPickerDialog
|
import com.simplemobiletools.commons.dialogs.ColorPickerDialog
|
||||||
import com.simplemobiletools.commons.extensions.adjustAlpha
|
import com.simplemobiletools.commons.extensions.*
|
||||||
import com.simplemobiletools.commons.extensions.applyColorFilter
|
|
||||||
import com.simplemobiletools.commons.extensions.beVisible
|
|
||||||
import com.simplemobiletools.commons.extensions.setFillWithStroke
|
|
||||||
import com.simplemobiletools.commons.helpers.LOWER_ALPHA
|
import com.simplemobiletools.commons.helpers.LOWER_ALPHA
|
||||||
import kotlinx.android.synthetic.main.first_row.*
|
import kotlinx.android.synthetic.main.first_row.*
|
||||||
import kotlinx.android.synthetic.main.top_navigation.*
|
import kotlinx.android.synthetic.main.top_navigation.*
|
||||||
@ -131,7 +128,7 @@ class WidgetMonthlyConfigureActivity : SimpleActivity(), MonthlyCalendar {
|
|||||||
private fun updateColors() {
|
private fun updateColors() {
|
||||||
mTextColor = mTextColorWithoutTransparency
|
mTextColor = mTextColorWithoutTransparency
|
||||||
mWeakTextColor = mTextColorWithoutTransparency.adjustAlpha(LOWER_ALPHA)
|
mWeakTextColor = mTextColorWithoutTransparency.adjustAlpha(LOWER_ALPHA)
|
||||||
mPrimaryColor = config.primaryColor
|
mPrimaryColor = getProperPrimaryColor()
|
||||||
mWeekendsTextColor = config.highlightWeekendsColor
|
mWeekendsTextColor = config.highlightWeekendsColor
|
||||||
mHighlightWeekends = config.highlightWeekends
|
mHighlightWeekends = config.highlightWeekends
|
||||||
|
|
||||||
|
@ -14,6 +14,7 @@ import com.simplemobiletools.commons.adapters.MyRecyclerViewAdapter
|
|||||||
import com.simplemobiletools.commons.extensions.adjustAlpha
|
import com.simplemobiletools.commons.extensions.adjustAlpha
|
||||||
import com.simplemobiletools.commons.extensions.applyColorFilter
|
import com.simplemobiletools.commons.extensions.applyColorFilter
|
||||||
import com.simplemobiletools.commons.extensions.beVisibleIf
|
import com.simplemobiletools.commons.extensions.beVisibleIf
|
||||||
|
import com.simplemobiletools.commons.extensions.getProperTextColor
|
||||||
import com.simplemobiletools.commons.helpers.MEDIUM_ALPHA
|
import com.simplemobiletools.commons.helpers.MEDIUM_ALPHA
|
||||||
import com.simplemobiletools.commons.helpers.ensureBackgroundThread
|
import com.simplemobiletools.commons.helpers.ensureBackgroundThread
|
||||||
import com.simplemobiletools.commons.views.MyRecyclerView
|
import com.simplemobiletools.commons.views.MyRecyclerView
|
||||||
@ -73,7 +74,7 @@ class DayEventsAdapter(activity: SimpleActivity, val events: ArrayList<Event>, r
|
|||||||
textColor = if (isPrintVersion) {
|
textColor = if (isPrintVersion) {
|
||||||
resources.getColor(R.color.theme_light_text_color)
|
resources.getColor(R.color.theme_light_text_color)
|
||||||
} else {
|
} else {
|
||||||
baseConfig.textColor
|
activity.getProperTextColor()
|
||||||
}
|
}
|
||||||
notifyDataSetChanged()
|
notifyDataSetChanged()
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,6 @@ import com.simplemobiletools.calendar.pro.activities.SimpleActivity
|
|||||||
import com.simplemobiletools.calendar.pro.dialogs.DeleteEventDialog
|
import com.simplemobiletools.calendar.pro.dialogs.DeleteEventDialog
|
||||||
import com.simplemobiletools.calendar.pro.extensions.*
|
import com.simplemobiletools.calendar.pro.extensions.*
|
||||||
import com.simplemobiletools.calendar.pro.helpers.*
|
import com.simplemobiletools.calendar.pro.helpers.*
|
||||||
import com.simplemobiletools.calendar.pro.helpers.Formatter
|
|
||||||
import com.simplemobiletools.calendar.pro.models.ListEvent
|
import com.simplemobiletools.calendar.pro.models.ListEvent
|
||||||
import com.simplemobiletools.calendar.pro.models.ListItem
|
import com.simplemobiletools.calendar.pro.models.ListItem
|
||||||
import com.simplemobiletools.calendar.pro.models.ListSectionDay
|
import com.simplemobiletools.calendar.pro.models.ListSectionDay
|
||||||
@ -18,13 +17,13 @@ import com.simplemobiletools.commons.adapters.MyRecyclerViewAdapter
|
|||||||
import com.simplemobiletools.commons.extensions.adjustAlpha
|
import com.simplemobiletools.commons.extensions.adjustAlpha
|
||||||
import com.simplemobiletools.commons.extensions.applyColorFilter
|
import com.simplemobiletools.commons.extensions.applyColorFilter
|
||||||
import com.simplemobiletools.commons.extensions.beVisibleIf
|
import com.simplemobiletools.commons.extensions.beVisibleIf
|
||||||
|
import com.simplemobiletools.commons.extensions.getProperTextColor
|
||||||
import com.simplemobiletools.commons.helpers.MEDIUM_ALPHA
|
import com.simplemobiletools.commons.helpers.MEDIUM_ALPHA
|
||||||
import com.simplemobiletools.commons.helpers.ensureBackgroundThread
|
import com.simplemobiletools.commons.helpers.ensureBackgroundThread
|
||||||
import com.simplemobiletools.commons.interfaces.RefreshRecyclerViewListener
|
import com.simplemobiletools.commons.interfaces.RefreshRecyclerViewListener
|
||||||
import com.simplemobiletools.commons.views.MyRecyclerView
|
import com.simplemobiletools.commons.views.MyRecyclerView
|
||||||
import kotlinx.android.synthetic.main.event_list_item.view.*
|
import kotlinx.android.synthetic.main.event_list_item.view.*
|
||||||
import kotlinx.android.synthetic.main.event_list_section_day.view.*
|
import kotlinx.android.synthetic.main.event_list_section_day.view.*
|
||||||
import java.util.*
|
|
||||||
|
|
||||||
class EventListAdapter(
|
class EventListAdapter(
|
||||||
activity: SimpleActivity, var listItems: ArrayList<ListItem>, val allowLongClick: Boolean, val listener: RefreshRecyclerViewListener?,
|
activity: SimpleActivity, var listItems: ArrayList<ListItem>, val allowLongClick: Boolean, val listener: RefreshRecyclerViewListener?,
|
||||||
@ -123,7 +122,7 @@ class EventListAdapter(
|
|||||||
textColor = if (isPrintVersion) {
|
textColor = if (isPrintVersion) {
|
||||||
resources.getColor(R.color.theme_light_text_color)
|
resources.getColor(R.color.theme_light_text_color)
|
||||||
} else {
|
} else {
|
||||||
baseConfig.textColor
|
activity.getProperTextColor()
|
||||||
}
|
}
|
||||||
notifyDataSetChanged()
|
notifyDataSetChanged()
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,7 @@ import com.simplemobiletools.calendar.pro.models.EventType
|
|||||||
import com.simplemobiletools.commons.adapters.MyRecyclerViewAdapter
|
import com.simplemobiletools.commons.adapters.MyRecyclerViewAdapter
|
||||||
import com.simplemobiletools.commons.dialogs.ConfirmationDialog
|
import com.simplemobiletools.commons.dialogs.ConfirmationDialog
|
||||||
import com.simplemobiletools.commons.dialogs.RadioGroupDialog
|
import com.simplemobiletools.commons.dialogs.RadioGroupDialog
|
||||||
|
import com.simplemobiletools.commons.extensions.getProperBackgroundColor
|
||||||
import com.simplemobiletools.commons.extensions.setFillWithStroke
|
import com.simplemobiletools.commons.extensions.setFillWithStroke
|
||||||
import com.simplemobiletools.commons.extensions.toast
|
import com.simplemobiletools.commons.extensions.toast
|
||||||
import com.simplemobiletools.commons.models.RadioItem
|
import com.simplemobiletools.commons.models.RadioItem
|
||||||
@ -70,7 +71,7 @@ class ManageEventTypesAdapter(
|
|||||||
view.apply {
|
view.apply {
|
||||||
event_item_frame.isSelected = selectedKeys.contains(eventType.id?.toInt())
|
event_item_frame.isSelected = selectedKeys.contains(eventType.id?.toInt())
|
||||||
event_type_title.text = eventType.getDisplayTitle()
|
event_type_title.text = eventType.getDisplayTitle()
|
||||||
event_type_color.setFillWithStroke(eventType.color, activity.config.backgroundColor)
|
event_type_color.setFillWithStroke(eventType.color, activity.getProperBackgroundColor())
|
||||||
event_type_title.setTextColor(textColor)
|
event_type_title.setTextColor(textColor)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,7 @@ import com.simplemobiletools.calendar.pro.activities.SimpleActivity
|
|||||||
import com.simplemobiletools.calendar.pro.extensions.config
|
import com.simplemobiletools.calendar.pro.extensions.config
|
||||||
import com.simplemobiletools.calendar.pro.models.EventType
|
import com.simplemobiletools.calendar.pro.models.EventType
|
||||||
import com.simplemobiletools.commons.extensions.adjustAlpha
|
import com.simplemobiletools.commons.extensions.adjustAlpha
|
||||||
|
import com.simplemobiletools.commons.extensions.getProperTextColor
|
||||||
import com.simplemobiletools.commons.helpers.LOWER_ALPHA
|
import com.simplemobiletools.commons.helpers.LOWER_ALPHA
|
||||||
import kotlinx.android.synthetic.main.quick_filter_event_type_view.view.*
|
import kotlinx.android.synthetic.main.quick_filter_event_type_view.view.*
|
||||||
import java.util.*
|
import java.util.*
|
||||||
@ -23,7 +24,7 @@ class QuickFilterEventTypeAdapter(
|
|||||||
private val quickFilterEventTypes = ArrayList<EventType>()
|
private val quickFilterEventTypes = ArrayList<EventType>()
|
||||||
private val displayEventTypes = activity.config.displayEventTypes
|
private val displayEventTypes = activity.config.displayEventTypes
|
||||||
|
|
||||||
private val textColorActive = activity.config.textColor
|
private val textColorActive = activity.getProperTextColor()
|
||||||
private val textColorInactive = textColorActive.adjustAlpha(LOWER_ALPHA)
|
private val textColorInactive = textColorActive.adjustAlpha(LOWER_ALPHA)
|
||||||
|
|
||||||
private val minItemWidth = activity.resources.getDimensionPixelSize(R.dimen.quick_filter_min_width)
|
private val minItemWidth = activity.resources.getDimensionPixelSize(R.dimen.quick_filter_min_width)
|
||||||
|
@ -5,14 +5,13 @@ import android.view.ViewGroup
|
|||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import com.simplemobiletools.calendar.pro.R
|
import com.simplemobiletools.calendar.pro.R
|
||||||
import com.simplemobiletools.calendar.pro.activities.SimpleActivity
|
import com.simplemobiletools.calendar.pro.activities.SimpleActivity
|
||||||
import com.simplemobiletools.calendar.pro.extensions.config
|
|
||||||
import com.simplemobiletools.calendar.pro.models.MyTimeZone
|
import com.simplemobiletools.calendar.pro.models.MyTimeZone
|
||||||
|
import com.simplemobiletools.commons.extensions.getProperTextColor
|
||||||
import kotlinx.android.synthetic.main.item_select_time_zone.view.*
|
import kotlinx.android.synthetic.main.item_select_time_zone.view.*
|
||||||
import java.util.*
|
|
||||||
|
|
||||||
class SelectTimeZoneAdapter(val activity: SimpleActivity, var timeZones: ArrayList<MyTimeZone>, val itemClick: (Any) -> Unit) :
|
class SelectTimeZoneAdapter(val activity: SimpleActivity, var timeZones: ArrayList<MyTimeZone>, val itemClick: (Any) -> Unit) :
|
||||||
RecyclerView.Adapter<SelectTimeZoneAdapter.ViewHolder>() {
|
RecyclerView.Adapter<SelectTimeZoneAdapter.ViewHolder>() {
|
||||||
val textColor = activity.config.textColor
|
val textColor = activity.getProperTextColor()
|
||||||
|
|
||||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
|
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
|
||||||
val view = activity.layoutInflater.inflate(R.layout.item_select_time_zone, parent, false)
|
val view = activity.layoutInflater.inflate(R.layout.item_select_time_zone, parent, false)
|
||||||
|
@ -17,6 +17,7 @@ import com.simplemobiletools.calendar.pro.interfaces.WidgetsDao
|
|||||||
import com.simplemobiletools.calendar.pro.models.Event
|
import com.simplemobiletools.calendar.pro.models.Event
|
||||||
import com.simplemobiletools.calendar.pro.models.EventType
|
import com.simplemobiletools.calendar.pro.models.EventType
|
||||||
import com.simplemobiletools.calendar.pro.models.Widget
|
import com.simplemobiletools.calendar.pro.models.Widget
|
||||||
|
import com.simplemobiletools.commons.extensions.getProperPrimaryColor
|
||||||
import java.util.concurrent.Executors
|
import java.util.concurrent.Executors
|
||||||
|
|
||||||
@Database(entities = [Event::class, EventType::class, Widget::class], version = 6)
|
@Database(entities = [Event::class, EventType::class, Widget::class], version = 6)
|
||||||
@ -63,7 +64,7 @@ abstract class EventsDatabase : RoomDatabase() {
|
|||||||
private fun insertRegularEventType(context: Context) {
|
private fun insertRegularEventType(context: Context) {
|
||||||
Executors.newSingleThreadScheduledExecutor().execute {
|
Executors.newSingleThreadScheduledExecutor().execute {
|
||||||
val regularEvent = context.resources.getString(R.string.regular_event)
|
val regularEvent = context.resources.getString(R.string.regular_event)
|
||||||
val eventType = EventType(REGULAR_EVENT_TYPE_ID, regularEvent, context.config.primaryColor)
|
val eventType = EventType(REGULAR_EVENT_TYPE_ID, regularEvent, context.getProperPrimaryColor())
|
||||||
db!!.EventTypesDao().insertOrUpdate(eventType)
|
db!!.EventTypesDao().insertOrUpdate(eventType)
|
||||||
context.config.addDisplayEventType(REGULAR_EVENT_TYPE_ID.toString())
|
context.config.addDisplayEventType(REGULAR_EVENT_TYPE_ID.toString())
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ class EditEventTypeDialog(val activity: Activity, var eventType: EventType? = nu
|
|||||||
|
|
||||||
init {
|
init {
|
||||||
if (eventType == null) {
|
if (eventType == null) {
|
||||||
eventType = EventType(null, "", activity.config.primaryColor)
|
eventType = EventType(null, "", activity.getProperPrimaryColor())
|
||||||
}
|
}
|
||||||
|
|
||||||
val view = activity.layoutInflater.inflate(R.layout.dialog_event_type, null).apply {
|
val view = activity.layoutInflater.inflate(R.layout.dialog_event_type, null).apply {
|
||||||
@ -56,7 +56,7 @@ class EditEventTypeDialog(val activity: Activity, var eventType: EventType? = nu
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun setupColor(view: ImageView) {
|
private fun setupColor(view: ImageView) {
|
||||||
view.setFillWithStroke(eventType!!.color, activity.config.backgroundColor)
|
view.setFillWithStroke(eventType!!.color, activity.getProperBackgroundColor())
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun eventTypeConfirmed(title: String, dialog: AlertDialog) {
|
private fun eventTypeConfirmed(title: String, dialog: AlertDialog) {
|
||||||
|
@ -13,6 +13,7 @@ import com.simplemobiletools.calendar.pro.helpers.IcsImporter.ImportResult.IMPOR
|
|||||||
import com.simplemobiletools.calendar.pro.helpers.IcsImporter.ImportResult.IMPORT_OK
|
import com.simplemobiletools.calendar.pro.helpers.IcsImporter.ImportResult.IMPORT_OK
|
||||||
import com.simplemobiletools.calendar.pro.helpers.IcsImporter.ImportResult.IMPORT_PARTIAL
|
import com.simplemobiletools.calendar.pro.helpers.IcsImporter.ImportResult.IMPORT_PARTIAL
|
||||||
import com.simplemobiletools.calendar.pro.helpers.REGULAR_EVENT_TYPE_ID
|
import com.simplemobiletools.calendar.pro.helpers.REGULAR_EVENT_TYPE_ID
|
||||||
|
import com.simplemobiletools.commons.extensions.getProperBackgroundColor
|
||||||
import com.simplemobiletools.commons.extensions.setFillWithStroke
|
import com.simplemobiletools.commons.extensions.setFillWithStroke
|
||||||
import com.simplemobiletools.commons.extensions.setupDialogStuff
|
import com.simplemobiletools.commons.extensions.setupDialogStuff
|
||||||
import com.simplemobiletools.commons.extensions.toast
|
import com.simplemobiletools.commons.extensions.toast
|
||||||
@ -93,7 +94,7 @@ class ImportEventsDialog(val activity: SimpleActivity, val path: String, val cal
|
|||||||
val eventType = activity.eventTypesDB.getEventTypeWithId(currEventTypeId)
|
val eventType = activity.eventTypesDB.getEventTypeWithId(currEventTypeId)
|
||||||
activity.runOnUiThread {
|
activity.runOnUiThread {
|
||||||
view.import_event_type_title.text = eventType!!.getDisplayTitle()
|
view.import_event_type_title.text = eventType!!.getDisplayTitle()
|
||||||
view.import_event_type_color.setFillWithStroke(eventType.color, activity.config.backgroundColor)
|
view.import_event_type_color.setFillWithStroke(eventType.color, activity.getProperBackgroundColor())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,7 @@ import com.simplemobiletools.calendar.pro.extensions.config
|
|||||||
import com.simplemobiletools.calendar.pro.extensions.eventsHelper
|
import com.simplemobiletools.calendar.pro.extensions.eventsHelper
|
||||||
import com.simplemobiletools.calendar.pro.helpers.STORED_LOCALLY_ONLY
|
import com.simplemobiletools.calendar.pro.helpers.STORED_LOCALLY_ONLY
|
||||||
import com.simplemobiletools.calendar.pro.models.CalDAVCalendar
|
import com.simplemobiletools.calendar.pro.models.CalDAVCalendar
|
||||||
|
import com.simplemobiletools.commons.extensions.getProperBackgroundColor
|
||||||
import com.simplemobiletools.commons.extensions.setFillWithStroke
|
import com.simplemobiletools.commons.extensions.setFillWithStroke
|
||||||
import com.simplemobiletools.commons.extensions.setupDialogStuff
|
import com.simplemobiletools.commons.extensions.setupDialogStuff
|
||||||
import com.simplemobiletools.commons.extensions.updateTextColors
|
import com.simplemobiletools.commons.extensions.updateTextColors
|
||||||
@ -60,7 +61,7 @@ class SelectEventCalendarDialog(val activity: Activity, val calendars: List<CalD
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (typeId != STORED_LOCALLY_ONLY) {
|
if (typeId != STORED_LOCALLY_ONLY) {
|
||||||
view.dialog_radio_color.setFillWithStroke(color, activity.config.backgroundColor)
|
view.dialog_radio_color.setFillWithStroke(color, activity.getProperBackgroundColor())
|
||||||
}
|
}
|
||||||
|
|
||||||
view.setOnClickListener { viewClicked(typeId) }
|
view.setOnClickListener { viewClicked(typeId) }
|
||||||
|
@ -10,6 +10,7 @@ import com.simplemobiletools.calendar.pro.extensions.calDAVHelper
|
|||||||
import com.simplemobiletools.calendar.pro.extensions.config
|
import com.simplemobiletools.calendar.pro.extensions.config
|
||||||
import com.simplemobiletools.calendar.pro.models.EventType
|
import com.simplemobiletools.calendar.pro.models.EventType
|
||||||
import com.simplemobiletools.commons.dialogs.ColorPickerDialog
|
import com.simplemobiletools.commons.dialogs.ColorPickerDialog
|
||||||
|
import com.simplemobiletools.commons.extensions.getProperBackgroundColor
|
||||||
import com.simplemobiletools.commons.extensions.setFillWithStroke
|
import com.simplemobiletools.commons.extensions.setFillWithStroke
|
||||||
import com.simplemobiletools.commons.extensions.setupDialogStuff
|
import com.simplemobiletools.commons.extensions.setupDialogStuff
|
||||||
import kotlinx.android.synthetic.main.dialog_select_event_type_color.view.*
|
import kotlinx.android.synthetic.main.dialog_select_event_type_color.view.*
|
||||||
@ -51,7 +52,7 @@ class SelectEventTypeColorDialog(val activity: Activity, val eventType: EventTyp
|
|||||||
id = colorKey
|
id = colorKey
|
||||||
}
|
}
|
||||||
|
|
||||||
view.dialog_radio_color.setFillWithStroke(color, activity.config.backgroundColor)
|
view.dialog_radio_color.setFillWithStroke(color, activity.getProperBackgroundColor())
|
||||||
view.setOnClickListener {
|
view.setOnClickListener {
|
||||||
viewClicked(colorKey)
|
viewClicked(colorKey)
|
||||||
}
|
}
|
||||||
|
@ -9,10 +9,7 @@ import com.simplemobiletools.calendar.pro.R
|
|||||||
import com.simplemobiletools.calendar.pro.extensions.config
|
import com.simplemobiletools.calendar.pro.extensions.config
|
||||||
import com.simplemobiletools.calendar.pro.extensions.eventsHelper
|
import com.simplemobiletools.calendar.pro.extensions.eventsHelper
|
||||||
import com.simplemobiletools.calendar.pro.models.EventType
|
import com.simplemobiletools.calendar.pro.models.EventType
|
||||||
import com.simplemobiletools.commons.extensions.hideKeyboard
|
import com.simplemobiletools.commons.extensions.*
|
||||||
import com.simplemobiletools.commons.extensions.setFillWithStroke
|
|
||||||
import com.simplemobiletools.commons.extensions.setupDialogStuff
|
|
||||||
import com.simplemobiletools.commons.extensions.updateTextColors
|
|
||||||
import com.simplemobiletools.commons.views.MyCompatRadioButton
|
import com.simplemobiletools.commons.views.MyCompatRadioButton
|
||||||
import kotlinx.android.synthetic.main.dialog_select_radio_group.view.*
|
import kotlinx.android.synthetic.main.dialog_select_radio_group.view.*
|
||||||
import kotlinx.android.synthetic.main.radio_button_with_color.view.*
|
import kotlinx.android.synthetic.main.radio_button_with_color.view.*
|
||||||
@ -68,7 +65,7 @@ class SelectEventTypeDialog(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (eventType.color != Color.TRANSPARENT) {
|
if (eventType.color != Color.TRANSPARENT) {
|
||||||
view.dialog_radio_color.setFillWithStroke(eventType.color, activity.config.backgroundColor)
|
view.dialog_radio_color.setFillWithStroke(eventType.color, activity.getProperBackgroundColor())
|
||||||
}
|
}
|
||||||
|
|
||||||
view.setOnClickListener { viewClicked(eventType) }
|
view.setOnClickListener { viewClicked(eventType) }
|
||||||
|
@ -20,7 +20,7 @@ class SetRemindersDialog(val activity: Activity, val eventType: Int, val callbac
|
|||||||
|
|
||||||
init {
|
init {
|
||||||
val view = activity.layoutInflater.inflate(R.layout.dialog_set_reminders, null).apply {
|
val view = activity.layoutInflater.inflate(R.layout.dialog_set_reminders, null).apply {
|
||||||
set_reminders_image.applyColorFilter(context.config.textColor)
|
set_reminders_image.applyColorFilter(context.getProperTextColor())
|
||||||
set_reminders_1.text = activity.getFormattedMinutes(mReminder1Minutes)
|
set_reminders_1.text = activity.getFormattedMinutes(mReminder1Minutes)
|
||||||
set_reminders_2.text = activity.getFormattedMinutes(mReminder1Minutes)
|
set_reminders_2.text = activity.getFormattedMinutes(mReminder1Minutes)
|
||||||
set_reminders_3.text = activity.getFormattedMinutes(mReminder1Minutes)
|
set_reminders_3.text = activity.getFormattedMinutes(mReminder1Minutes)
|
||||||
|
@ -20,10 +20,7 @@ import com.simplemobiletools.calendar.pro.helpers.*
|
|||||||
import com.simplemobiletools.calendar.pro.helpers.Formatter
|
import com.simplemobiletools.calendar.pro.helpers.Formatter
|
||||||
import com.simplemobiletools.calendar.pro.interfaces.NavigationListener
|
import com.simplemobiletools.calendar.pro.interfaces.NavigationListener
|
||||||
import com.simplemobiletools.calendar.pro.models.Event
|
import com.simplemobiletools.calendar.pro.models.Event
|
||||||
import com.simplemobiletools.commons.extensions.applyColorFilter
|
import com.simplemobiletools.commons.extensions.*
|
||||||
import com.simplemobiletools.commons.extensions.areSystemAnimationsEnabled
|
|
||||||
import com.simplemobiletools.commons.extensions.beGone
|
|
||||||
import com.simplemobiletools.commons.extensions.beVisible
|
|
||||||
import kotlinx.android.synthetic.main.fragment_day.view.*
|
import kotlinx.android.synthetic.main.fragment_day.view.*
|
||||||
import kotlinx.android.synthetic.main.top_navigation.view.*
|
import kotlinx.android.synthetic.main.top_navigation.view.*
|
||||||
import java.util.*
|
import java.util.*
|
||||||
@ -51,7 +48,7 @@ class DayFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun setupButtons() {
|
private fun setupButtons() {
|
||||||
mTextColor = requireContext().config.textColor
|
mTextColor = requireContext().getProperTextColor()
|
||||||
|
|
||||||
mHolder.top_left_arrow.apply {
|
mHolder.top_left_arrow.apply {
|
||||||
applyColorFilter(mTextColor)
|
applyColorFilter(mTextColor)
|
||||||
@ -84,7 +81,7 @@ class DayFragment : Fragment() {
|
|||||||
setOnClickListener {
|
setOnClickListener {
|
||||||
(activity as MainActivity).showGoToDateDialog()
|
(activity as MainActivity).showGoToDateDialog()
|
||||||
}
|
}
|
||||||
setTextColor(context.config.textColor)
|
setTextColor(context.getProperTextColor())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -149,7 +146,7 @@ class DayFragment : Fragment() {
|
|||||||
Handler().postDelayed({
|
Handler().postDelayed({
|
||||||
top_left_arrow.beVisible()
|
top_left_arrow.beVisible()
|
||||||
top_right_arrow.beVisible()
|
top_right_arrow.beVisible()
|
||||||
top_value.setTextColor(requireContext().config.textColor)
|
top_value.setTextColor(requireContext().getProperTextColor())
|
||||||
(day_events.adapter as? DayEventsAdapter)?.togglePrintMode()
|
(day_events.adapter as? DayEventsAdapter)?.togglePrintMode()
|
||||||
}, 1000)
|
}, 1000)
|
||||||
}, 1000)
|
}, 1000)
|
||||||
|
@ -17,6 +17,7 @@ import com.simplemobiletools.calendar.pro.helpers.DAY_CODE
|
|||||||
import com.simplemobiletools.calendar.pro.helpers.Formatter
|
import com.simplemobiletools.calendar.pro.helpers.Formatter
|
||||||
import com.simplemobiletools.calendar.pro.interfaces.NavigationListener
|
import com.simplemobiletools.calendar.pro.interfaces.NavigationListener
|
||||||
import com.simplemobiletools.commons.extensions.getDialogTheme
|
import com.simplemobiletools.commons.extensions.getDialogTheme
|
||||||
|
import com.simplemobiletools.commons.extensions.getProperBackgroundColor
|
||||||
import com.simplemobiletools.commons.extensions.setupDialogStuff
|
import com.simplemobiletools.commons.extensions.setupDialogStuff
|
||||||
import com.simplemobiletools.commons.extensions.updateActionBarTitle
|
import com.simplemobiletools.commons.extensions.updateActionBarTitle
|
||||||
import com.simplemobiletools.commons.views.MyViewPager
|
import com.simplemobiletools.commons.views.MyViewPager
|
||||||
@ -43,7 +44,7 @@ class DayFragmentsHolder : MyFragmentHolder(), NavigationListener {
|
|||||||
|
|
||||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
||||||
val view = inflater.inflate(R.layout.fragment_days_holder, container, false)
|
val view = inflater.inflate(R.layout.fragment_days_holder, container, false)
|
||||||
view.background = ColorDrawable(requireContext().config.backgroundColor)
|
view.background = ColorDrawable(requireContext().getProperBackgroundColor())
|
||||||
viewPager = view.fragment_days_viewpager
|
viewPager = view.fragment_days_viewpager
|
||||||
viewPager!!.id = (System.currentTimeMillis() % 100000).toInt()
|
viewPager!!.id = (System.currentTimeMillis() % 100000).toInt()
|
||||||
setupFragment()
|
setupFragment()
|
||||||
|
@ -26,7 +26,6 @@ import com.simplemobiletools.commons.views.MyLinearLayoutManager
|
|||||||
import com.simplemobiletools.commons.views.MyRecyclerView
|
import com.simplemobiletools.commons.views.MyRecyclerView
|
||||||
import kotlinx.android.synthetic.main.fragment_event_list.view.*
|
import kotlinx.android.synthetic.main.fragment_event_list.view.*
|
||||||
import org.joda.time.DateTime
|
import org.joda.time.DateTime
|
||||||
import java.util.*
|
|
||||||
|
|
||||||
class EventListFragment : MyFragmentHolder(), RefreshRecyclerViewListener {
|
class EventListFragment : MyFragmentHolder(), RefreshRecyclerViewListener {
|
||||||
private val NOT_UPDATING = 0
|
private val NOT_UPDATING = 0
|
||||||
@ -51,7 +50,7 @@ class EventListFragment : MyFragmentHolder(), RefreshRecyclerViewListener {
|
|||||||
|
|
||||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
||||||
mView = inflater.inflate(R.layout.fragment_event_list, container, false)
|
mView = inflater.inflate(R.layout.fragment_event_list, container, false)
|
||||||
mView.background = ColorDrawable(requireContext().config.backgroundColor)
|
mView.background = ColorDrawable(requireContext().getProperBackgroundColor())
|
||||||
mView.calendar_events_list_holder?.id = (System.currentTimeMillis() % 100000).toInt()
|
mView.calendar_events_list_holder?.id = (System.currentTimeMillis() % 100000).toInt()
|
||||||
mView.calendar_empty_list_placeholder_2.apply {
|
mView.calendar_empty_list_placeholder_2.apply {
|
||||||
setTextColor(context.getProperPrimaryColor())
|
setTextColor(context.getProperPrimaryColor())
|
||||||
@ -171,7 +170,7 @@ class EventListFragment : MyFragmentHolder(), RefreshRecyclerViewListener {
|
|||||||
mView.calendar_empty_list_placeholder_2.beVisibleIf(mEvents.isEmpty())
|
mView.calendar_empty_list_placeholder_2.beVisibleIf(mEvents.isEmpty())
|
||||||
mView.calendar_events_list.beGoneIf(mEvents.isEmpty())
|
mView.calendar_events_list.beGoneIf(mEvents.isEmpty())
|
||||||
if (activity != null)
|
if (activity != null)
|
||||||
mView.calendar_empty_list_placeholder.setTextColor(requireActivity().config.textColor)
|
mView.calendar_empty_list_placeholder.setTextColor(requireActivity().getProperTextColor())
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun fetchPreviousPeriod() {
|
private fun fetchPreviousPeriod() {
|
||||||
|
@ -25,6 +25,7 @@ import com.simplemobiletools.calendar.pro.models.Event
|
|||||||
import com.simplemobiletools.calendar.pro.models.ListEvent
|
import com.simplemobiletools.calendar.pro.models.ListEvent
|
||||||
import com.simplemobiletools.commons.extensions.areSystemAnimationsEnabled
|
import com.simplemobiletools.commons.extensions.areSystemAnimationsEnabled
|
||||||
import com.simplemobiletools.commons.extensions.beVisibleIf
|
import com.simplemobiletools.commons.extensions.beVisibleIf
|
||||||
|
import com.simplemobiletools.commons.extensions.getProperTextColor
|
||||||
import com.simplemobiletools.commons.interfaces.RefreshRecyclerViewListener
|
import com.simplemobiletools.commons.interfaces.RefreshRecyclerViewListener
|
||||||
import kotlinx.android.synthetic.main.fragment_month_day.*
|
import kotlinx.android.synthetic.main.fragment_month_day.*
|
||||||
import kotlinx.android.synthetic.main.fragment_month_day.view.*
|
import kotlinx.android.synthetic.main.fragment_month_day.view.*
|
||||||
@ -166,7 +167,7 @@ class MonthDayFragment : Fragment(), MonthlyCalendar, RefreshRecyclerViewListene
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun setupButtons() {
|
private fun setupButtons() {
|
||||||
val textColor = mConfig.textColor
|
val textColor = requireContext().getProperTextColor()
|
||||||
mHolder.apply {
|
mHolder.apply {
|
||||||
month_day_selected_day_label.setTextColor(textColor)
|
month_day_selected_day_label.setTextColor(textColor)
|
||||||
month_day_no_events_placeholder.setTextColor(textColor)
|
month_day_no_events_placeholder.setTextColor(textColor)
|
||||||
|
@ -12,16 +12,12 @@ import androidx.viewpager.widget.ViewPager
|
|||||||
import com.simplemobiletools.calendar.pro.R
|
import com.simplemobiletools.calendar.pro.R
|
||||||
import com.simplemobiletools.calendar.pro.activities.MainActivity
|
import com.simplemobiletools.calendar.pro.activities.MainActivity
|
||||||
import com.simplemobiletools.calendar.pro.adapters.MyMonthDayPagerAdapter
|
import com.simplemobiletools.calendar.pro.adapters.MyMonthDayPagerAdapter
|
||||||
import com.simplemobiletools.calendar.pro.extensions.config
|
|
||||||
import com.simplemobiletools.calendar.pro.extensions.getMonthCode
|
import com.simplemobiletools.calendar.pro.extensions.getMonthCode
|
||||||
import com.simplemobiletools.calendar.pro.helpers.DAY_CODE
|
import com.simplemobiletools.calendar.pro.helpers.DAY_CODE
|
||||||
import com.simplemobiletools.calendar.pro.helpers.Formatter
|
import com.simplemobiletools.calendar.pro.helpers.Formatter
|
||||||
import com.simplemobiletools.calendar.pro.helpers.MONTHLY_DAILY_VIEW
|
import com.simplemobiletools.calendar.pro.helpers.MONTHLY_DAILY_VIEW
|
||||||
import com.simplemobiletools.calendar.pro.interfaces.NavigationListener
|
import com.simplemobiletools.calendar.pro.interfaces.NavigationListener
|
||||||
import com.simplemobiletools.commons.extensions.beGone
|
import com.simplemobiletools.commons.extensions.*
|
||||||
import com.simplemobiletools.commons.extensions.getDialogTheme
|
|
||||||
import com.simplemobiletools.commons.extensions.setupDialogStuff
|
|
||||||
import com.simplemobiletools.commons.extensions.updateActionBarTitle
|
|
||||||
import com.simplemobiletools.commons.views.MyViewPager
|
import com.simplemobiletools.commons.views.MyViewPager
|
||||||
import kotlinx.android.synthetic.main.fragment_months_days_holder.view.*
|
import kotlinx.android.synthetic.main.fragment_months_days_holder.view.*
|
||||||
import org.joda.time.DateTime
|
import org.joda.time.DateTime
|
||||||
@ -45,7 +41,7 @@ class MonthDayFragmentsHolder : MyFragmentHolder(), NavigationListener {
|
|||||||
|
|
||||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
||||||
val view = inflater.inflate(R.layout.fragment_months_days_holder, container, false)
|
val view = inflater.inflate(R.layout.fragment_months_days_holder, container, false)
|
||||||
view.background = ColorDrawable(requireContext().config.backgroundColor)
|
view.background = ColorDrawable(requireContext().getProperBackgroundColor())
|
||||||
viewPager = view.fragment_months_days_viewpager
|
viewPager = view.fragment_months_days_viewpager
|
||||||
viewPager!!.id = (System.currentTimeMillis() % 100000).toInt()
|
viewPager!!.id = (System.currentTimeMillis() % 100000).toInt()
|
||||||
setupFragment()
|
setupFragment()
|
||||||
|
@ -23,6 +23,7 @@ import com.simplemobiletools.calendar.pro.models.DayMonthly
|
|||||||
import com.simplemobiletools.commons.extensions.applyColorFilter
|
import com.simplemobiletools.commons.extensions.applyColorFilter
|
||||||
import com.simplemobiletools.commons.extensions.beGone
|
import com.simplemobiletools.commons.extensions.beGone
|
||||||
import com.simplemobiletools.commons.extensions.beVisible
|
import com.simplemobiletools.commons.extensions.beVisible
|
||||||
|
import com.simplemobiletools.commons.extensions.getProperTextColor
|
||||||
import kotlinx.android.synthetic.main.fragment_month.view.*
|
import kotlinx.android.synthetic.main.fragment_month.view.*
|
||||||
import kotlinx.android.synthetic.main.top_navigation.view.*
|
import kotlinx.android.synthetic.main.top_navigation.view.*
|
||||||
import org.joda.time.DateTime
|
import org.joda.time.DateTime
|
||||||
@ -100,14 +101,14 @@ class MonthFragment : Fragment(), MonthlyCalendar {
|
|||||||
mHolder.top_value.apply {
|
mHolder.top_value.apply {
|
||||||
text = month
|
text = month
|
||||||
contentDescription = text
|
contentDescription = text
|
||||||
setTextColor(mConfig.textColor)
|
setTextColor(requireContext().getProperTextColor())
|
||||||
}
|
}
|
||||||
updateDays(days)
|
updateDays(days)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setupButtons() {
|
private fun setupButtons() {
|
||||||
mTextColor = mConfig.textColor
|
mTextColor = requireContext().getProperTextColor()
|
||||||
|
|
||||||
mHolder.top_left_arrow.apply {
|
mHolder.top_left_arrow.apply {
|
||||||
applyColorFilter(mTextColor)
|
applyColorFilter(mTextColor)
|
||||||
@ -134,7 +135,7 @@ class MonthFragment : Fragment(), MonthlyCalendar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mHolder.top_value.apply {
|
mHolder.top_value.apply {
|
||||||
setTextColor(mConfig.textColor)
|
setTextColor(requireContext().getProperTextColor())
|
||||||
setOnClickListener {
|
setOnClickListener {
|
||||||
(activity as MainActivity).showGoToDateDialog()
|
(activity as MainActivity).showGoToDateDialog()
|
||||||
}
|
}
|
||||||
@ -158,7 +159,7 @@ class MonthFragment : Fragment(), MonthlyCalendar {
|
|||||||
|
|
||||||
top_left_arrow.beVisible()
|
top_left_arrow.beVisible()
|
||||||
top_right_arrow.beVisible()
|
top_right_arrow.beVisible()
|
||||||
top_value.setTextColor(mConfig.textColor)
|
top_value.setTextColor(requireContext().getProperTextColor())
|
||||||
month_view_wrapper.togglePrintMode()
|
month_view_wrapper.togglePrintMode()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,10 +18,7 @@ import com.simplemobiletools.calendar.pro.helpers.DAY_CODE
|
|||||||
import com.simplemobiletools.calendar.pro.helpers.Formatter
|
import com.simplemobiletools.calendar.pro.helpers.Formatter
|
||||||
import com.simplemobiletools.calendar.pro.helpers.MONTHLY_VIEW
|
import com.simplemobiletools.calendar.pro.helpers.MONTHLY_VIEW
|
||||||
import com.simplemobiletools.calendar.pro.interfaces.NavigationListener
|
import com.simplemobiletools.calendar.pro.interfaces.NavigationListener
|
||||||
import com.simplemobiletools.commons.extensions.beGone
|
import com.simplemobiletools.commons.extensions.*
|
||||||
import com.simplemobiletools.commons.extensions.getDialogTheme
|
|
||||||
import com.simplemobiletools.commons.extensions.setupDialogStuff
|
|
||||||
import com.simplemobiletools.commons.extensions.updateActionBarTitle
|
|
||||||
import com.simplemobiletools.commons.views.MyViewPager
|
import com.simplemobiletools.commons.views.MyViewPager
|
||||||
import kotlinx.android.synthetic.main.fragment_months_holder.view.*
|
import kotlinx.android.synthetic.main.fragment_months_holder.view.*
|
||||||
import org.joda.time.DateTime
|
import org.joda.time.DateTime
|
||||||
@ -45,7 +42,7 @@ class MonthFragmentsHolder : MyFragmentHolder(), NavigationListener {
|
|||||||
|
|
||||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
||||||
val view = inflater.inflate(R.layout.fragment_months_holder, container, false)
|
val view = inflater.inflate(R.layout.fragment_months_holder, container, false)
|
||||||
view.background = ColorDrawable(requireContext().config.backgroundColor)
|
view.background = ColorDrawable(requireContext().getProperBackgroundColor())
|
||||||
viewPager = view.fragment_months_viewpager
|
viewPager = view.fragment_months_viewpager
|
||||||
viewPager!!.id = (System.currentTimeMillis() % 100000).toInt()
|
viewPager!!.id = (System.currentTimeMillis() % 100000).toInt()
|
||||||
setupFragment()
|
setupFragment()
|
||||||
|
@ -224,7 +224,7 @@ class WeekFragment : Fragment(), WeeklyCalendar {
|
|||||||
} else if (highlightWeekends && isWeekend(curDay.dayOfWeek, true)) {
|
} else if (highlightWeekends && isWeekend(curDay.dayOfWeek, true)) {
|
||||||
config.highlightWeekendsColor
|
config.highlightWeekendsColor
|
||||||
} else {
|
} else {
|
||||||
config.textColor
|
requireContext().getProperTextColor()
|
||||||
}
|
}
|
||||||
|
|
||||||
val label = inflater.inflate(R.layout.weekly_view_day_letter, mView.week_letters_holder, false) as MyTextView
|
val label = inflater.inflate(R.layout.weekly_view_day_letter, mView.week_letters_holder, false) as MyTextView
|
||||||
|
@ -51,7 +51,7 @@ class WeekFragmentsHolder : MyFragmentHolder(), WeekFragmentListener {
|
|||||||
|
|
||||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
||||||
weekHolder = inflater.inflate(R.layout.fragment_week_holder, container, false) as ViewGroup
|
weekHolder = inflater.inflate(R.layout.fragment_week_holder, container, false) as ViewGroup
|
||||||
weekHolder!!.background = ColorDrawable(requireContext().config.backgroundColor)
|
weekHolder!!.background = ColorDrawable(requireContext().getProperBackgroundColor())
|
||||||
|
|
||||||
val itemHeight = requireContext().getWeeklyViewItemHeight().toInt()
|
val itemHeight = requireContext().getWeeklyViewItemHeight().toInt()
|
||||||
weekHolder!!.week_view_hours_holder.setPadding(0, 0, 0, itemHeight)
|
weekHolder!!.week_view_hours_holder.setPadding(0, 0, 0, itemHeight)
|
||||||
@ -128,7 +128,7 @@ class WeekFragmentsHolder : MyFragmentHolder(), WeekFragmentListener {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun addHours(textColor: Int = requireContext().config.textColor) {
|
private fun addHours(textColor: Int = requireContext().getProperTextColor()) {
|
||||||
val itemHeight = requireContext().getWeeklyViewItemHeight().toInt()
|
val itemHeight = requireContext().getWeeklyViewItemHeight().toInt()
|
||||||
weekHolder!!.week_view_hours_holder.removeAllViews()
|
weekHolder!!.week_view_hours_holder.removeAllViews()
|
||||||
val hourDateTime = DateTime().withDate(2000, 1, 1).withTime(0, 0, 0, 0)
|
val hourDateTime = DateTime().withDate(2000, 1, 1).withTime(0, 0, 0, 0)
|
||||||
@ -306,7 +306,7 @@ class WeekFragmentsHolder : MyFragmentHolder(), WeekFragmentListener {
|
|||||||
week_view_seekbar.beVisible()
|
week_view_seekbar.beVisible()
|
||||||
week_view_days_count.beVisible()
|
week_view_days_count.beVisible()
|
||||||
addHours()
|
addHours()
|
||||||
background = ColorDrawable(requireContext().config.backgroundColor)
|
background = ColorDrawable(requireContext().getProperBackgroundColor())
|
||||||
(viewPager?.adapter as? MyWeekPagerAdapter)?.togglePrintMode(viewPager?.currentItem ?: 0)
|
(viewPager?.adapter as? MyWeekPagerAdapter)?.togglePrintMode(viewPager?.currentItem ?: 0)
|
||||||
}, 1000)
|
}, 1000)
|
||||||
}, 1000)
|
}, 1000)
|
||||||
|
@ -18,6 +18,7 @@ import com.simplemobiletools.calendar.pro.interfaces.YearlyCalendar
|
|||||||
import com.simplemobiletools.calendar.pro.models.DayYearly
|
import com.simplemobiletools.calendar.pro.models.DayYearly
|
||||||
import com.simplemobiletools.calendar.pro.views.SmallMonthView
|
import com.simplemobiletools.calendar.pro.views.SmallMonthView
|
||||||
import com.simplemobiletools.commons.extensions.getProperPrimaryColor
|
import com.simplemobiletools.commons.extensions.getProperPrimaryColor
|
||||||
|
import com.simplemobiletools.commons.extensions.getProperTextColor
|
||||||
import com.simplemobiletools.commons.extensions.updateTextColors
|
import com.simplemobiletools.commons.extensions.updateTextColors
|
||||||
import kotlinx.android.synthetic.main.fragment_year.view.*
|
import kotlinx.android.synthetic.main.fragment_year.view.*
|
||||||
import org.joda.time.DateTime
|
import org.joda.time.DateTime
|
||||||
@ -77,7 +78,7 @@ class YearFragment : Fragment(), YearlyCalendar {
|
|||||||
val monthLabel = mView.findViewById<TextView>(resources.getIdentifier("month_${i}_label", "id", requireContext().packageName))
|
val monthLabel = mView.findViewById<TextView>(resources.getIdentifier("month_${i}_label", "id", requireContext().packageName))
|
||||||
val curTextColor = when {
|
val curTextColor = when {
|
||||||
isPrintVersion -> resources.getColor(R.color.theme_light_text_color)
|
isPrintVersion -> resources.getColor(R.color.theme_light_text_color)
|
||||||
else -> requireContext().config.textColor
|
else -> requireContext().getProperTextColor()
|
||||||
}
|
}
|
||||||
|
|
||||||
monthLabel.setTextColor(curTextColor)
|
monthLabel.setTextColor(curTextColor)
|
||||||
|
@ -12,17 +12,14 @@ import androidx.viewpager.widget.ViewPager
|
|||||||
import com.simplemobiletools.calendar.pro.R
|
import com.simplemobiletools.calendar.pro.R
|
||||||
import com.simplemobiletools.calendar.pro.activities.MainActivity
|
import com.simplemobiletools.calendar.pro.activities.MainActivity
|
||||||
import com.simplemobiletools.calendar.pro.adapters.MyYearPagerAdapter
|
import com.simplemobiletools.calendar.pro.adapters.MyYearPagerAdapter
|
||||||
import com.simplemobiletools.calendar.pro.extensions.config
|
|
||||||
import com.simplemobiletools.calendar.pro.helpers.Formatter
|
import com.simplemobiletools.calendar.pro.helpers.Formatter
|
||||||
import com.simplemobiletools.calendar.pro.helpers.YEARLY_VIEW
|
import com.simplemobiletools.calendar.pro.helpers.YEARLY_VIEW
|
||||||
import com.simplemobiletools.calendar.pro.helpers.YEAR_TO_OPEN
|
import com.simplemobiletools.calendar.pro.helpers.YEAR_TO_OPEN
|
||||||
import com.simplemobiletools.commons.extensions.beGone
|
import com.simplemobiletools.commons.extensions.*
|
||||||
import com.simplemobiletools.commons.extensions.getDialogTheme
|
|
||||||
import com.simplemobiletools.commons.extensions.setupDialogStuff
|
|
||||||
import com.simplemobiletools.commons.extensions.updateActionBarTitle
|
|
||||||
import com.simplemobiletools.commons.views.MyViewPager
|
import com.simplemobiletools.commons.views.MyViewPager
|
||||||
import kotlinx.android.synthetic.main.fragment_years_holder.view.*
|
import kotlinx.android.synthetic.main.fragment_years_holder.view.*
|
||||||
import org.joda.time.DateTime
|
import org.joda.time.DateTime
|
||||||
|
import kotlin.text.toInt
|
||||||
|
|
||||||
class YearFragmentsHolder : MyFragmentHolder() {
|
class YearFragmentsHolder : MyFragmentHolder() {
|
||||||
private val PREFILLED_YEARS = 61
|
private val PREFILLED_YEARS = 61
|
||||||
@ -44,7 +41,7 @@ class YearFragmentsHolder : MyFragmentHolder() {
|
|||||||
|
|
||||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
||||||
val view = inflater.inflate(R.layout.fragment_years_holder, container, false)
|
val view = inflater.inflate(R.layout.fragment_years_holder, container, false)
|
||||||
view.background = ColorDrawable(requireContext().config.backgroundColor)
|
view.background = ColorDrawable(requireContext().getProperBackgroundColor())
|
||||||
viewPager = view.fragment_years_viewpager
|
viewPager = view.fragment_years_viewpager
|
||||||
viewPager!!.id = (System.currentTimeMillis() % 100000).toInt()
|
viewPager!!.id = (System.currentTimeMillis() % 100000).toInt()
|
||||||
setupFragment()
|
setupFragment()
|
||||||
|
@ -8,6 +8,7 @@ import com.simplemobiletools.calendar.pro.R
|
|||||||
import com.simplemobiletools.calendar.pro.extensions.*
|
import com.simplemobiletools.calendar.pro.extensions.*
|
||||||
import com.simplemobiletools.calendar.pro.models.Event
|
import com.simplemobiletools.calendar.pro.models.Event
|
||||||
import com.simplemobiletools.calendar.pro.models.EventType
|
import com.simplemobiletools.calendar.pro.models.EventType
|
||||||
|
import com.simplemobiletools.commons.extensions.getProperPrimaryColor
|
||||||
import com.simplemobiletools.commons.extensions.toast
|
import com.simplemobiletools.commons.extensions.toast
|
||||||
import com.simplemobiletools.commons.helpers.CHOPPED_LIST_DEFAULT_SIZE
|
import com.simplemobiletools.commons.helpers.CHOPPED_LIST_DEFAULT_SIZE
|
||||||
import com.simplemobiletools.commons.helpers.ensureBackgroundThread
|
import com.simplemobiletools.commons.helpers.ensureBackgroundThread
|
||||||
@ -239,7 +240,7 @@ class EventsHelper(val context: Context) {
|
|||||||
|
|
||||||
filteredEvents.forEach {
|
filteredEvents.forEach {
|
||||||
it.updateIsPastEvent()
|
it.updateIsPastEvent()
|
||||||
it.color = eventTypeColors.get(it.eventType) ?: config.primaryColor
|
it.color = eventTypeColors.get(it.eventType) ?: context.getProperPrimaryColor()
|
||||||
}
|
}
|
||||||
|
|
||||||
activity.runOnUiThread {
|
activity.runOnUiThread {
|
||||||
@ -330,7 +331,7 @@ class EventsHelper(val context: Context) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
it.color = eventTypeColors.get(it.eventType) ?: config.primaryColor
|
it.color = eventTypeColors.get(it.eventType) ?: context.getProperPrimaryColor()
|
||||||
}
|
}
|
||||||
|
|
||||||
callback(events)
|
callback(events)
|
||||||
|
@ -419,7 +419,7 @@ class MonthView(context: Context, attrs: AttributeSet, defStyle: Int) : View(con
|
|||||||
textColor = if (isPrintVersion) {
|
textColor = if (isPrintVersion) {
|
||||||
resources.getColor(R.color.theme_light_text_color)
|
resources.getColor(R.color.theme_light_text_color)
|
||||||
} else {
|
} else {
|
||||||
config.textColor
|
context.getProperTextColor()
|
||||||
}
|
}
|
||||||
|
|
||||||
textPaint.color = textColor
|
textPaint.color = textColor
|
||||||
|
@ -12,8 +12,8 @@ import com.simplemobiletools.calendar.pro.helpers.isWeekend
|
|||||||
import com.simplemobiletools.calendar.pro.models.DayYearly
|
import com.simplemobiletools.calendar.pro.models.DayYearly
|
||||||
import com.simplemobiletools.commons.extensions.adjustAlpha
|
import com.simplemobiletools.commons.extensions.adjustAlpha
|
||||||
import com.simplemobiletools.commons.extensions.getProperPrimaryColor
|
import com.simplemobiletools.commons.extensions.getProperPrimaryColor
|
||||||
|
import com.simplemobiletools.commons.extensions.getProperTextColor
|
||||||
import com.simplemobiletools.commons.helpers.MEDIUM_ALPHA
|
import com.simplemobiletools.commons.helpers.MEDIUM_ALPHA
|
||||||
import java.util.*
|
|
||||||
|
|
||||||
// used for displaying months at Yearly view
|
// used for displaying months at Yearly view
|
||||||
class SmallMonthView(context: Context, attrs: AttributeSet, defStyle: Int) : View(context, attrs, defStyle) {
|
class SmallMonthView(context: Context, attrs: AttributeSet, defStyle: Int) : View(context, attrs, defStyle) {
|
||||||
@ -57,7 +57,7 @@ class SmallMonthView(context: Context, attrs: AttributeSet, defStyle: Int) : Vie
|
|||||||
attributes.recycle()
|
attributes.recycle()
|
||||||
}
|
}
|
||||||
|
|
||||||
val baseColor = context.config.textColor
|
val baseColor = context.getProperTextColor()
|
||||||
textColor = baseColor.adjustAlpha(MEDIUM_ALPHA)
|
textColor = baseColor.adjustAlpha(MEDIUM_ALPHA)
|
||||||
weekendsTextColor = context.config.highlightWeekendsColor.adjustAlpha(MEDIUM_ALPHA)
|
weekendsTextColor = context.config.highlightWeekendsColor.adjustAlpha(MEDIUM_ALPHA)
|
||||||
highlightWeekends = context.config.highlightWeekends
|
highlightWeekends = context.config.highlightWeekends
|
||||||
@ -121,7 +121,7 @@ class SmallMonthView(context: Context, attrs: AttributeSet, defStyle: Int) : Vie
|
|||||||
textColor = if (isPrintVersion) {
|
textColor = if (isPrintVersion) {
|
||||||
resources.getColor(R.color.theme_light_text_color)
|
resources.getColor(R.color.theme_light_text_color)
|
||||||
} else {
|
} else {
|
||||||
context.config.textColor.adjustAlpha(MEDIUM_ALPHA)
|
context.getProperTextColor().adjustAlpha(MEDIUM_ALPHA)
|
||||||
}
|
}
|
||||||
|
|
||||||
paint.color = textColor
|
paint.color = textColor
|
||||||
|
Reference in New Issue
Block a user