Merge branch 'master' into add-bdays-anniv-automatically

This commit is contained in:
Agnieszka C 2021-11-21 18:03:17 +01:00 committed by GitHub
commit 442a8ac7e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
122 changed files with 2435 additions and 2486 deletions

View File

@ -63,10 +63,10 @@ android {
}
dependencies {
implementation 'com.github.SimpleMobileTools:Simple-Commons:f1d626ef3d'
implementation 'com.github.SimpleMobileTools:Simple-Commons:307941253d'
implementation 'joda-time:joda-time:2.10.3'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
implementation "androidx.print:print:1.0.0"

View File

@ -0,0 +1,352 @@
BEGIN:VCALENDAR
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_1
DTSTART;VALUE=DATE:20210114
DTEND;VALUE=DATE:20210115
SUMMARY:Tamil Thai Pongal Day
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_2
DTSTART;VALUE=DATE:20210128
DTEND;VALUE=DATE:20210129
SUMMARY:Duruthu Full Moon Poya Day
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_3
DTSTART;VALUE=DATE:20210204
DTEND;VALUE=DATE:20210205
SUMMARY:Independence Day
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_4
DTSTART;VALUE=DATE:20210226
DTEND;VALUE=DATE:20210227
SUMMARY:Nawam Full Moon Poya Day
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_5
DTSTART;VALUE=DATE:20210311
DTEND;VALUE=DATE:20210312
SUMMARY:Mahasivarathri Day
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_6
DTSTART;VALUE=DATE:20210328
DTEND;VALUE=DATE:20210329
SUMMARY:Madin Full Moon Poya Day
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_7
DTSTART;VALUE=DATE:20210402
DTEND;VALUE=DATE:20210403
SUMMARY:Good Friday
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_8
DTSTART;VALUE=DATE:20210413
DTEND;VALUE=DATE:20210414
SUMMARY:Day prior to Sinhala & Tamil New Year Day
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_9
DTSTART;VALUE=DATE:20210414
DTEND;VALUE=DATE:20210415
SUMMARY:Sinhala & Tamil New Year Day
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_10
DTSTART;VALUE=DATE:20210426
DTEND;VALUE=DATE:20210427
SUMMARY:Bak Full Moon Poya Day
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_11
DTSTART;VALUE=DATE:20210501
DTEND;VALUE=DATE:20210502
SUMMARY:May Day
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_12
DTSTART;VALUE=DATE:20210514
DTEND;VALUE=DATE:20210515
SUMMARY:Id-Ul-Fitr (Ramazan Festival Day)
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_13
DTSTART;VALUE=DATE:20210526
DTEND;VALUE=DATE:20210527
SUMMARY:Vesak Full Moon Poya Day
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_14
DTSTART;VALUE=DATE:20210527
DTEND;VALUE=DATE:20210528
SUMMARY:Day following Vesak Full Moon Poya Day
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_15
DTSTART;VALUE=DATE:20210624
DTEND;VALUE=DATE:20210625
SUMMARY:Poson Full Moon Poya Day
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_16
DTSTART;VALUE=DATE:20210721
DTEND;VALUE=DATE:20210722
SUMMARY:Id-Ul-Alha (Hadji Festival Day)
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_17
DTSTART;VALUE=DATE:20210723
DTEND;VALUE=DATE:20210724
SUMMARY:Esala Full Moon Poya Day
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_18
DTSTART;VALUE=DATE:20210822
DTEND;VALUE=DATE:20210823
SUMMARY:Nikini Full Moon Poya Day
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_19
DTSTART;VALUE=DATE:20210920
DTEND;VALUE=DATE:20210921
SUMMARY:Binara Full Moon Poya Day
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_20
DTSTART;VALUE=DATE:20211019
DTEND;VALUE=DATE:20211020
SUMMARY:Milad-Un-Nabi (Holy Prophets Birthday)
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_21
DTSTART;VALUE=DATE:20211020
DTEND;VALUE=DATE:20211021
SUMMARY:Vap Full Moon Poya Day
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_22
DTSTART;VALUE=DATE:20211104
DTEND;VALUE=DATE:20211105
SUMMARY:Deepavali Festival Day
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_23
DTSTART;VALUE=DATE:20211118
DTEND;VALUE=DATE:20211119
SUMMARY:Ill Full Moon Poya Day
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_24
DTSTART;VALUE=DATE:20211218
DTEND;VALUE=DATE:20211219
SUMMARY:Unduvap Full Moon Poya Day
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_25
DTSTART;VALUE=DATE:20211225
DTEND;VALUE=DATE:20211226
SUMMARY:Christmas Day
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_26
DTSTART;VALUE=DATE:20220114
DTEND;VALUE=DATE:20220115
SUMMARY:Tamil Thai Pongal Day
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_27
DTSTART;VALUE=DATE:20220117
DTEND;VALUE=DATE:20220118
SUMMARY:Duruthu Full Moon Poya Day
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_28
DTSTART;VALUE=DATE:20220204
DTEND;VALUE=DATE:20220205
SUMMARY:Independence Day
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_29
DTSTART;VALUE=DATE:20220216
DTEND;VALUE=DATE:20220217
SUMMARY:Nawam Full Moon Poya Day
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_30
DTSTART;VALUE=DATE:20220301
DTEND;VALUE=DATE:20220302
SUMMARY:Mahasivarathri Day
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_31
DTSTART;VALUE=DATE:20220317
DTEND;VALUE=DATE:20220318
SUMMARY:Madin Full Moon Poya Day
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_32
DTSTART;VALUE=DATE:20220413
DTEND;VALUE=DATE:20220414
SUMMARY:Day prior to Sinhala & Tamil New Year Day
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_33
DTSTART;VALUE=DATE:20220414
DTEND;VALUE=DATE:20220415
SUMMARY:Sinhala & Tamil New Year Day
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_34
DTSTART;VALUE=DATE:20220415
DTEND;VALUE=DATE:20220416
SUMMARY:Good Friday
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_35
DTSTART;VALUE=DATE:20220416
DTEND;VALUE=DATE:20220417
SUMMARY:Bak Full Moon Poya Day
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_36
DTSTART;VALUE=DATE:20220501
DTEND;VALUE=DATE:20220502
SUMMARY:May Day
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_37
DTSTART;VALUE=DATE:20220503
DTEND;VALUE=DATE:20220504
SUMMARY:Id-Ul-Fitr (Ramazan Festival Day)
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_38
DTSTART;VALUE=DATE:20220515
DTEND;VALUE=DATE:20220516
SUMMARY:Vesak Full Moon Poya Day
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_39
DTSTART;VALUE=DATE:20220516
DTEND;VALUE=DATE:20220517
SUMMARY:Day following Vesak Full Moon Poya Day
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_40
DTSTART;VALUE=DATE:20220614
DTEND;VALUE=DATE:20220615
SUMMARY:Poson Full Moon Poya Day
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_41
DTSTART;VALUE=DATE:20220710
DTEND;VALUE=DATE:20220711
SUMMARY:Id-Ul-Alha (Hadji Festival Day)
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_42
DTSTART;VALUE=DATE:20220713
DTEND;VALUE=DATE:20220714
SUMMARY:Esala Full Moon Poya Day
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_43
DTSTART;VALUE=DATE:20220811
DTEND;VALUE=DATE:20220812
SUMMARY:Nikini Full Moon Poya Day
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_44
DTSTART;VALUE=DATE:20220910
DTEND;VALUE=DATE:20220911
SUMMARY:Binara Full Moon Poya Day
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_45
DTSTART;VALUE=DATE:20221009
DTEND;VALUE=DATE:20221010
SUMMARY:Vap Full Moon Poya Day
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_46
DTSTART;VALUE=DATE:20221009
DTEND;VALUE=DATE:20221010
SUMMARY:Milad-Un-Nabi (Holy Prophets Birthday)
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_47
DTSTART;VALUE=DATE:20221024
DTEND;VALUE=DATE:20221025
SUMMARY:Deepavali Festival Day
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_48
DTSTART;VALUE=DATE:20221107
DTEND;VALUE=DATE:20221108
SUMMARY:Ill Full Moon Poya Day
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_49
DTSTART;VALUE=DATE:20221207
DTEND;VALUE=DATE:20221208
SUMMARY:Unduvap Full Moon Poya Day
END:VEVENT
BEGIN:VEVENT
STATUS:CONFIRMED
UID:sl_50
DTSTART;VALUE=DATE:20221225
DTEND;VALUE=DATE:20221226
SUMMARY:Christmas Day
END:VEVENT
END:VCALENDAR

View File

@ -233,6 +233,10 @@ class EventActivity : SimpleActivity() {
jumpDrawablesToCurrentState()
}
event_all_day_holder.setOnClickListener {
event_all_day.toggle()
}
updateTextColors(event_scrollview)
updateIconColors()
event_time_zone_image.beVisibleIf(config.allowChangingTimeZones)
@ -288,6 +292,10 @@ class EventActivity : SimpleActivity() {
}
private fun isEventChanged(): Boolean {
if (!this::mEvent.isInitialized) {
return false
}
var newStartTS: Long
var newEndTS: Long
getStartEndTimes().apply {
@ -881,13 +889,13 @@ class EventActivity : SimpleActivity() {
private fun updateReminderTypeImage(view: ImageView, reminder: Reminder) {
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_email_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)
view.setImageDrawable(icon)
}
private fun updateAvailabilityImage() {
val drawable = if (mAvailability == Attendees.AVAILABILITY_FREE) R.drawable.ic_event_available else R.drawable.ic_event_occupied
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)
event_availability_image.setImageDrawable(icon)
}
@ -906,7 +914,7 @@ class EventActivity : SimpleActivity() {
if (eventType != null) {
runOnUiThread {
event_type.text = eventType.title
event_type_color.setFillWithStroke(eventType.color, config.backgroundColor, getCornerRadius())
event_type_color.setFillWithStroke(eventType.color, config.backgroundColor)
}
}
}
@ -974,7 +982,7 @@ class EventActivity : SimpleActivity() {
val calendarColor = eventsHelper.getEventTypeWithCalDAVCalendarId(currentCalendar.id)?.color ?: currentCalendar.color
runOnUiThread {
event_caldav_calendar_color.setFillWithStroke(calendarColor, config.backgroundColor, getCornerRadius())
event_caldav_calendar_color.setFillWithStroke(calendarColor, config.backgroundColor)
event_caldav_calendar_name.apply {
text = currentCalendar.displayName
setPadding(paddingLeft, paddingTop, paddingRight, resources.getDimension(R.dimen.tiny_margin).toInt())

View File

@ -1130,6 +1130,7 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
put("Slovenija", "slovenia.ics")
put("Slovensko", "slovakia.ics")
put("South Africa", "southafrica.ics")
put("Sri Lanka", "srilanka.ics")
put("Suomi", "finland.ics")
put("Sverige", "sweden.ics")
put("Taiwan", "taiwan.ics")

View File

@ -83,10 +83,32 @@ class SettingsActivity : SimpleActivity() {
setupAllowChangingTimeZones()
updateTextColors(settings_holder)
checkPrimaryColor()
setupSectionColors()
setupExportSettings()
setupImportSettings()
invalidateOptionsMenu()
arrayOf(
settings_color_customization_label, settings_general_settings_label, settings_reminders_label, settings_caldav_label, settings_new_events_label,
settings_weekly_view_label, settings_monthly_view_label, settings_event_lists_label, settings_widgets_label, settings_events_label, settings_migrating_label
).forEach {
it.setTextColor(getAdjustedPrimaryColor())
}
arrayOf(
settings_color_customization_holder,
settings_general_settings_holder,
settings_reminders_holder,
settings_caldav_holder,
settings_new_events_holder,
settings_weekly_view_holder,
settings_monthly_view_holder,
settings_event_lists_holder,
settings_widgets_holder,
settings_events_holder,
settings_migrating_holder
).forEach {
it.background.applyColorFilter(baseConfig.backgroundColor.getContrastColor())
}
}
override fun onPause() {
@ -131,16 +153,6 @@ class SettingsActivity : SimpleActivity() {
}
}
private fun setupSectionColors() {
val adjustedPrimaryColor = getAdjustedPrimaryColor()
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 {
it.setTextColor(adjustedPrimaryColor)
}
}
private fun setupCustomizeColors() {
settings_customize_colors_holder.setOnClickListener {
startCustomizationActivity()
@ -149,6 +161,11 @@ class SettingsActivity : SimpleActivity() {
private fun setupCustomizeNotifications() {
settings_customize_notifications_holder.beVisibleIf(isOreoPlus())
if (settings_customize_notifications_holder.isGone()) {
settings_reminder_sound_holder.background = resources.getDrawable(R.drawable.ripple_top_corners, theme)
}
settings_customize_notifications_holder.setOnClickListener {
launchCustomizeNotificationsIntent()
}
@ -157,6 +174,11 @@ class SettingsActivity : SimpleActivity() {
private fun setupUseEnglish() {
settings_use_english_holder.beVisibleIf(config.wasUseEnglishToggled || Locale.getDefault().language != "en")
settings_use_english.isChecked = config.useEnglish
if (settings_use_english_holder.isGone()) {
settings_manage_event_types_holder.background = resources.getDrawable(R.drawable.ripple_top_corners, theme)
}
settings_use_english_holder.setOnClickListener {
settings_use_english.toggle()
config.useEnglish = settings_use_english.isChecked
@ -190,6 +212,7 @@ class SettingsActivity : SimpleActivity() {
private fun setupCaldavSync() {
settings_caldav_sync.isChecked = config.caldavSync
checkCalDAVBackgrounds()
settings_caldav_sync_holder.setOnClickListener {
if (config.caldavSync) {
toggleCaldavSync(false)
@ -210,12 +233,22 @@ class SettingsActivity : SimpleActivity() {
private fun setupPullToRefresh() {
settings_caldav_pull_to_refresh_holder.beVisibleIf(config.caldavSync)
settings_caldav_pull_to_refresh.isChecked = config.pullToRefresh
checkCalDAVBackgrounds()
settings_caldav_pull_to_refresh_holder.setOnClickListener {
settings_caldav_pull_to_refresh.toggle()
config.pullToRefresh = settings_caldav_pull_to_refresh.isChecked
}
}
private fun checkCalDAVBackgrounds() {
if (config.caldavSync) {
settings_caldav_sync_holder.background = resources.getDrawable(R.drawable.ripple_top_corners, theme)
settings_manage_synced_calendars_holder.background = resources.getDrawable(R.drawable.ripple_bottom_corners, theme)
} else {
settings_caldav_sync_holder.background = resources.getDrawable(R.drawable.ripple_all_corners, theme)
}
}
private fun setupManageSyncedCalendars() {
settings_manage_synced_calendars_holder.beVisibleIf(config.caldavSync)
settings_manage_synced_calendars_holder.setOnClickListener {
@ -240,6 +273,7 @@ class SettingsActivity : SimpleActivity() {
updateDefaultEventTypeText()
}
}
checkCalDAVBackgrounds()
}
private fun showCalendarPicker() {
@ -453,10 +487,20 @@ class SettingsActivity : SimpleActivity() {
private fun setupUseSameSnooze() {
settings_snooze_time_holder.beVisibleIf(config.useSameSnooze)
settings_use_same_snooze.isChecked = config.useSameSnooze
setupSnoozeBackgrounds()
settings_use_same_snooze_holder.setOnClickListener {
settings_use_same_snooze.toggle()
config.useSameSnooze = settings_use_same_snooze.isChecked
settings_snooze_time_holder.beVisibleIf(config.useSameSnooze)
setupSnoozeBackgrounds()
}
}
private fun setupSnoozeBackgrounds() {
if (config.useSameSnooze) {
settings_use_same_snooze_holder.background = resources.getDrawable(R.drawable.ripple_background, theme)
} else {
settings_use_same_snooze_holder.background = resources.getDrawable(R.drawable.ripple_bottom_corners, theme)
}
}
@ -518,6 +562,12 @@ class SettingsActivity : SimpleActivity() {
arrayOf(settings_default_reminder_1_holder, settings_default_reminder_2_holder, settings_default_reminder_3_holder).forEach {
it.beVisibleIf(show)
}
if (show) {
settings_use_last_event_reminders_holder.background = resources.getDrawable(R.drawable.ripple_background, theme)
} else {
settings_use_last_event_reminders_holder.background = resources.getDrawable(R.drawable.ripple_bottom_corners, theme)
}
}
private fun getHoursString(hours: Int) = String.format("%02d:00", hours)

View File

@ -14,7 +14,7 @@ import com.simplemobiletools.calendar.pro.helpers.Formatter
import com.simplemobiletools.calendar.pro.helpers.MyWidgetListProvider
import com.simplemobiletools.calendar.pro.models.ListEvent
import com.simplemobiletools.calendar.pro.models.ListItem
import com.simplemobiletools.calendar.pro.models.ListSection
import com.simplemobiletools.calendar.pro.models.ListSectionDay
import com.simplemobiletools.commons.dialogs.ColorPickerDialog
import com.simplemobiletools.commons.extensions.adjustAlpha
import com.simplemobiletools.commons.extensions.applyColorFilter
@ -138,25 +138,90 @@ class WidgetListConfigureActivity : SimpleActivity() {
val listItems = ArrayList<ListItem>(10)
var dateTime = DateTime.now().withTime(0, 0, 0, 0).plusDays(1)
var code = Formatter.getDayCodeFromTS(dateTime.seconds())
var day = Formatter.getDayTitle(this, code)
listItems.add(ListSection(day, code, false, false))
var day = Formatter.getDateDayTitle(code)
listItems.add(ListSectionDay(day, code, false, false))
var time = dateTime.withHourOfDay(7)
listItems.add(ListEvent(1, time.seconds(), time.plusMinutes(30).seconds(), getString(R.string.sample_title_1), getString(R.string.sample_description_1), false, config.primaryColor, "", false, false))
listItems.add(
ListEvent(
1,
time.seconds(),
time.plusMinutes(30).seconds(),
getString(R.string.sample_title_1),
getString(R.string.sample_description_1),
false,
config.primaryColor,
"",
false,
false
)
)
time = dateTime.withHourOfDay(8)
listItems.add(ListEvent(2, time.seconds(), time.plusHours(1).seconds(), getString(R.string.sample_title_2), getString(R.string.sample_description_2), false, config.primaryColor, "", false, false))
listItems.add(
ListEvent(
2,
time.seconds(),
time.plusHours(1).seconds(),
getString(R.string.sample_title_2),
getString(R.string.sample_description_2),
false,
config.primaryColor,
"",
false,
false
)
)
dateTime = dateTime.plusDays(1)
code = Formatter.getDayCodeFromTS(dateTime.seconds())
day = Formatter.getDayTitle(this, code)
listItems.add(ListSection(day, code, false, false))
day = Formatter.getDateDayTitle(code)
listItems.add(ListSectionDay(day, code, false, false))
time = dateTime.withHourOfDay(8)
listItems.add(ListEvent(3, time.seconds(), time.plusHours(1).seconds(), getString(R.string.sample_title_3), "", false, config.primaryColor, "", false, false))
listItems.add(
ListEvent(
3,
time.seconds(),
time.plusHours(1).seconds(),
getString(R.string.sample_title_3),
"",
false,
config.primaryColor,
"",
false,
false
)
)
time = dateTime.withHourOfDay(13)
listItems.add(ListEvent(4, time.seconds(), time.plusHours(1).seconds(), getString(R.string.sample_title_4), getString(R.string.sample_description_4), false, config.primaryColor, "", false, false))
listItems.add(
ListEvent(
4,
time.seconds(),
time.plusHours(1).seconds(),
getString(R.string.sample_title_4),
getString(R.string.sample_description_4),
false,
config.primaryColor,
"",
false,
false
)
)
time = dateTime.withHourOfDay(18)
listItems.add(ListEvent(5, time.seconds(), time.plusMinutes(10).seconds(), getString(R.string.sample_title_5), "", false, config.primaryColor, "", false, false))
listItems.add(
ListEvent(
5,
time.seconds(),
time.plusMinutes(10).seconds(),
getString(R.string.sample_title_5),
"",
false,
config.primaryColor,
"",
false,
false
)
)
return listItems
}

View File

@ -11,21 +11,18 @@ import com.simplemobiletools.calendar.pro.extensions.eventsHelper
import com.simplemobiletools.calendar.pro.extensions.handleEventDeleting
import com.simplemobiletools.calendar.pro.extensions.shareEvents
import com.simplemobiletools.calendar.pro.helpers.Formatter
import com.simplemobiletools.calendar.pro.helpers.ITEM_EVENT
import com.simplemobiletools.calendar.pro.helpers.ITEM_EVENT_SIMPLE
import com.simplemobiletools.calendar.pro.models.Event
import com.simplemobiletools.commons.adapters.MyRecyclerViewAdapter
import com.simplemobiletools.commons.extensions.adjustAlpha
import com.simplemobiletools.commons.extensions.applyColorFilter
import com.simplemobiletools.commons.extensions.beInvisible
import com.simplemobiletools.commons.extensions.beInvisibleIf
import com.simplemobiletools.commons.helpers.LOWER_ALPHA
import com.simplemobiletools.commons.extensions.beVisibleIf
import com.simplemobiletools.commons.helpers.MEDIUM_ALPHA
import com.simplemobiletools.commons.helpers.ensureBackgroundThread
import com.simplemobiletools.commons.views.MyRecyclerView
import kotlinx.android.synthetic.main.event_item_day_view.view.*
import kotlinx.android.synthetic.main.event_list_item.view.*
class DayEventsAdapter(activity: SimpleActivity, val events: ArrayList<Event>, recyclerView: MyRecyclerView, itemClick: (Any) -> Unit)
: MyRecyclerViewAdapter(activity, recyclerView, null, itemClick) {
class DayEventsAdapter(activity: SimpleActivity, val events: ArrayList<Event>, recyclerView: MyRecyclerView, itemClick: (Any) -> Unit) :
MyRecyclerViewAdapter(activity, recyclerView, null, itemClick) {
private val allDayString = resources.getString(R.string.all_day)
private val replaceDescriptionWithLocation = activity.config.replaceDescription
@ -59,13 +56,7 @@ class DayEventsAdapter(activity: SimpleActivity, val events: ArrayList<Event>, r
override fun onActionModeDestroyed() {}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
val layoutId = when (viewType) {
ITEM_EVENT -> R.layout.event_item_day_view
else -> R.layout.event_item_day_view_simple
}
return createViewHolder(layoutId, parent)
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = createViewHolder(R.layout.event_list_item, parent)
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val event = events[position]
@ -77,26 +68,6 @@ class DayEventsAdapter(activity: SimpleActivity, val events: ArrayList<Event>, r
override fun getItemCount() = events.size
override fun getItemViewType(position: Int): Int {
val event = events[position]
val detailField = if (replaceDescriptionWithLocation) event.location else event.description
return if (detailField.isNotEmpty()) {
ITEM_EVENT
} else if (event.startTS == event.endTS) {
ITEM_EVENT_SIMPLE
} else if (event.getIsAllDay()) {
val startCode = Formatter.getDayCodeFromTS(event.startTS)
val endCode = Formatter.getDayCodeFromTS(event.endTS)
if (startCode == endCode) {
ITEM_EVENT_SIMPLE
} else {
ITEM_EVENT
}
} else {
ITEM_EVENT
}
}
fun togglePrintMode() {
isPrintVersion = !isPrintVersion
textColor = if (isPrintVersion) {
@ -109,38 +80,24 @@ class DayEventsAdapter(activity: SimpleActivity, val events: ArrayList<Event>, r
private fun setupView(view: View, event: Event) {
view.apply {
event_item_frame.isSelected = selectedKeys.contains(event.id?.toInt())
event_item_holder.isSelected = selectedKeys.contains(event.id?.toInt())
event_item_holder.background.applyColorFilter(textColor)
event_item_title.text = event.title
event_item_description?.text = if (replaceDescriptionWithLocation) event.location else event.description
event_item_start.text = if (event.getIsAllDay()) allDayString else Formatter.getTimeFromTS(context, event.startTS)
event_item_end?.beInvisibleIf(event.startTS == event.endTS)
event_item_color_bar.background.applyColorFilter(event.color)
if (event.startTS != event.endTS) {
val startCode = Formatter.getDayCodeFromTS(event.startTS)
val endCode = Formatter.getDayCodeFromTS(event.endTS)
event_item_end?.apply {
text = Formatter.getTimeFromTS(context, event.endTS)
if (startCode != endCode) {
if (event.getIsAllDay()) {
text = Formatter.getDateFromCode(context, endCode, true)
} else {
append(" (${Formatter.getDateFromCode(context, endCode, true)})")
}
} else if (event.getIsAllDay()) {
beInvisible()
}
}
event_item_time.text = if (event.getIsAllDay()) allDayString else Formatter.getTimeFromTS(context, event.startTS)
if (event.startTS != event.endTS && !event.getIsAllDay()) {
event_item_time.text = "${event_item_time.text} - ${Formatter.getTimeFromTS(context, event.endTS)}"
}
event_item_description.text = if (replaceDescriptionWithLocation) event.location else event.description
event_item_description.beVisibleIf(event_item_description.text.isNotEmpty())
event_item_color_bar.background.applyColorFilter(event.color)
var newTextColor = textColor
if (dimPastEvents && event.isPastEvent && !isPrintVersion) {
newTextColor = newTextColor.adjustAlpha(LOWER_ALPHA)
newTextColor = newTextColor.adjustAlpha(MEDIUM_ALPHA)
}
event_item_start.setTextColor(newTextColor)
event_item_end?.setTextColor(newTextColor)
event_item_time.setTextColor(newTextColor)
event_item_title.setTextColor(newTextColor)
event_item_description?.setTextColor(newTextColor)
}

View File

@ -14,24 +14,25 @@ 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.ListItem
import com.simplemobiletools.calendar.pro.models.ListSection
import com.simplemobiletools.calendar.pro.models.ListSectionDay
import com.simplemobiletools.calendar.pro.models.ListSectionMonth
import com.simplemobiletools.commons.adapters.MyRecyclerViewAdapter
import com.simplemobiletools.commons.extensions.adjustAlpha
import com.simplemobiletools.commons.extensions.applyColorFilter
import com.simplemobiletools.commons.extensions.beInvisible
import com.simplemobiletools.commons.extensions.beInvisibleIf
import com.simplemobiletools.commons.helpers.LOWER_ALPHA
import com.simplemobiletools.commons.extensions.beVisibleIf
import com.simplemobiletools.commons.helpers.MEDIUM_ALPHA
import com.simplemobiletools.commons.helpers.ensureBackgroundThread
import com.simplemobiletools.commons.interfaces.RefreshRecyclerViewListener
import com.simplemobiletools.commons.views.MyRecyclerView
import kotlinx.android.synthetic.main.event_list_item.view.*
import kotlinx.android.synthetic.main.event_list_section.view.*
import kotlinx.android.synthetic.main.event_list_section_day.view.*
import java.util.*
class EventListAdapter(activity: SimpleActivity, var listItems: ArrayList<ListItem>, val allowLongClick: Boolean, val listener: RefreshRecyclerViewListener?,
recyclerView: MyRecyclerView, itemClick: (Any) -> Unit) : MyRecyclerViewAdapter(activity, recyclerView, null, itemClick) {
class EventListAdapter(
activity: SimpleActivity, var listItems: ArrayList<ListItem>, val allowLongClick: Boolean, val listener: RefreshRecyclerViewListener?,
recyclerView: MyRecyclerView, itemClick: (Any) -> Unit
) : MyRecyclerViewAdapter(activity, recyclerView, null, itemClick) {
private val topDivider = resources.getDrawable(R.drawable.divider_width)
private val allDayString = resources.getString(R.string.all_day)
private val replaceDescription = activity.config.replaceDescription
private val dimPastEvents = activity.config.dimPastEvents
@ -42,7 +43,7 @@ class EventListAdapter(activity: SimpleActivity, var listItems: ArrayList<ListIt
init {
setupDragListener(true)
val firstNonPastSectionIndex = listItems.indexOfFirst { it is ListSection && !it.isPastSection }
val firstNonPastSectionIndex = listItems.indexOfFirst { it is ListSectionDay && !it.isPastSection }
if (firstNonPastSectionIndex != -1) {
activity.runOnUiThread {
recyclerView.scrollToPosition(firstNonPastSectionIndex)
@ -75,9 +76,9 @@ class EventListAdapter(activity: SimpleActivity, var listItems: ArrayList<ListIt
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MyRecyclerViewAdapter.ViewHolder {
val layoutId = when (viewType) {
ITEM_EVENT -> R.layout.event_list_item
ITEM_EVENT_SIMPLE -> R.layout.event_list_item_simple
else -> R.layout.event_list_section
ITEM_SECTION_DAY -> R.layout.event_list_section_day
ITEM_SECTION_MONTH -> R.layout.event_list_section_month
else -> R.layout.event_list_item
}
return createViewHolder(layoutId, parent)
}
@ -85,10 +86,10 @@ class EventListAdapter(activity: SimpleActivity, var listItems: ArrayList<ListIt
override fun onBindViewHolder(holder: MyRecyclerViewAdapter.ViewHolder, position: Int) {
val listItem = listItems[position]
holder.bindView(listItem, true, allowLongClick && listItem is ListEvent) { itemView, layoutPosition ->
if (listItem is ListSection) {
setupListSection(itemView, listItem, position)
} else if (listItem is ListEvent) {
setupListEvent(itemView, listItem)
when (listItem) {
is ListSectionDay -> setupListSectionDay(itemView, listItem)
is ListEvent -> setupListEvent(itemView, listItem)
is ListSectionMonth -> setupListSectionMonth(itemView, listItem)
}
}
bindViewHolder(holder)
@ -96,26 +97,10 @@ class EventListAdapter(activity: SimpleActivity, var listItems: ArrayList<ListIt
override fun getItemCount() = listItems.size
override fun getItemViewType(position: Int) = if (listItems[position] is ListEvent) {
val event = listItems[position] as ListEvent
val detailField = if (replaceDescription) event.location else event.description
if (detailField.isNotEmpty()) {
ITEM_EVENT
} else if (event.startTS == event.endTS) {
ITEM_EVENT_SIMPLE
} else if (event.isAllDay) {
val startCode = Formatter.getDayCodeFromTS(event.startTS)
val endCode = Formatter.getDayCodeFromTS(event.endTS)
if (startCode == endCode) {
ITEM_EVENT_SIMPLE
} else {
ITEM_EVENT
}
} else {
ITEM_EVENT
}
} else {
ITEM_HEADER
override fun getItemViewType(position: Int) = when {
listItems[position] is ListEvent -> ITEM_EVENT
listItems[position] is ListSectionDay -> ITEM_SECTION_DAY
else -> ITEM_SECTION_MONTH
}
fun toggle24HourFormat(use24HourFormat: Boolean) {
@ -145,68 +130,56 @@ class EventListAdapter(activity: SimpleActivity, var listItems: ArrayList<ListIt
private fun setupListEvent(view: View, listEvent: ListEvent) {
view.apply {
event_item_frame.isSelected = selectedKeys.contains(listEvent.hashCode())
event_item_holder.isSelected = selectedKeys.contains(listEvent.hashCode())
event_item_holder.background.applyColorFilter(textColor)
event_item_title.text = listEvent.title
event_item_description?.text = if (replaceDescription) listEvent.location else listEvent.description
event_item_start.text = if (listEvent.isAllDay) allDayString else Formatter.getTimeFromTS(context, listEvent.startTS)
event_item_end?.beInvisibleIf(listEvent.startTS == listEvent.endTS)
event_item_color_bar.background.applyColorFilter(listEvent.color)
if (listEvent.startTS != listEvent.endTS) {
event_item_end?.apply {
val startCode = Formatter.getDayCodeFromTS(listEvent.startTS)
val endCode = Formatter.getDayCodeFromTS(listEvent.endTS)
text = Formatter.getTimeFromTS(context, listEvent.endTS)
if (startCode != endCode) {
if (listEvent.isAllDay) {
text = Formatter.getDateFromCode(context, endCode, true)
} else {
append(" (${Formatter.getDateFromCode(context, endCode, true)})")
}
} else if (listEvent.isAllDay) {
beInvisible()
}
}
event_item_time.text = if (listEvent.isAllDay) allDayString else Formatter.getTimeFromTS(context, listEvent.startTS)
if (listEvent.startTS != listEvent.endTS && !listEvent.isAllDay) {
event_item_time.text = "${event_item_time.text} - ${Formatter.getTimeFromTS(context, listEvent.endTS)}"
}
var startTextColor = textColor
var endTextColor = textColor
event_item_description.text = if (replaceDescription) listEvent.location else listEvent.description
event_item_description.beVisibleIf(event_item_description.text.isNotEmpty())
event_item_color_bar.background.applyColorFilter(listEvent.color)
var newTextColor = textColor
if (listEvent.isAllDay || listEvent.startTS <= now && listEvent.endTS <= now) {
if (listEvent.isAllDay && Formatter.getDayCodeFromTS(listEvent.startTS) == Formatter.getDayCodeFromTS(now) && !isPrintVersion) {
startTextColor = adjustedPrimaryColor
newTextColor = adjustedPrimaryColor
}
if (dimPastEvents && listEvent.isPastEvent && !isPrintVersion) {
startTextColor = startTextColor.adjustAlpha(LOWER_ALPHA)
endTextColor = endTextColor.adjustAlpha(LOWER_ALPHA)
newTextColor = newTextColor.adjustAlpha(MEDIUM_ALPHA)
}
} else if (listEvent.startTS <= now && listEvent.endTS >= now && !isPrintVersion) {
startTextColor = adjustedPrimaryColor
newTextColor = adjustedPrimaryColor
}
event_item_start.setTextColor(startTextColor)
event_item_end?.setTextColor(endTextColor)
event_item_title.setTextColor(startTextColor)
event_item_description?.setTextColor(startTextColor)
event_item_time.setTextColor(newTextColor)
event_item_title.setTextColor(newTextColor)
event_item_description.setTextColor(newTextColor)
}
}
private fun setupListSection(view: View, listSection: ListSection, position: Int) {
private fun setupListSectionDay(view: View, listSectionDay: ListSectionDay) {
view.event_section_title.apply {
text = listSection.title
setCompoundDrawablesWithIntrinsicBounds(null, if (position == 0) null else topDivider, null, null)
var color = if (listSection.isToday && !isPrintVersion) adjustedPrimaryColor else textColor
if (dimPastEvents && listSection.isPastSection && !isPrintVersion) {
color = color.adjustAlpha(LOWER_ALPHA)
}
setTextColor(color)
text = listSectionDay.title
val dayColor = if (listSectionDay.isToday) adjustedPrimaryColor else textColor
setTextColor(dayColor)
}
}
private fun setupListSectionMonth(view: View, listSectionMonth: ListSectionMonth) {
view.event_section_title.apply {
text = listSectionMonth.title
setTextColor(adjustedPrimaryColor)
}
}
private fun shareEvents() = activity.shareEvents(getSelectedEventIds())
private fun getSelectedEventIds() = listItems.filter { it is ListEvent && selectedKeys.contains(it.hashCode()) }.map { (it as ListEvent).id }.toMutableList() as ArrayList<Long>
private fun getSelectedEventIds() =
listItems.filter { it is ListEvent && selectedKeys.contains(it.hashCode()) }.map { (it as ListEvent).id }.toMutableList() as ArrayList<Long>
private fun askConfirmDelete() {
val eventIds = getSelectedEventIds()

View File

@ -2,107 +2,73 @@ package com.simplemobiletools.calendar.pro.adapters
import android.content.Context
import android.content.Intent
import android.view.View
import android.widget.RemoteViews
import android.widget.RemoteViewsService
import com.simplemobiletools.calendar.pro.R
import com.simplemobiletools.calendar.pro.R.id.event_item_holder
import com.simplemobiletools.calendar.pro.R.id.event_section_title
import com.simplemobiletools.calendar.pro.extensions.config
import com.simplemobiletools.calendar.pro.extensions.eventsHelper
import com.simplemobiletools.calendar.pro.extensions.getWidgetFontSize
import com.simplemobiletools.calendar.pro.extensions.seconds
import com.simplemobiletools.calendar.pro.extensions.*
import com.simplemobiletools.calendar.pro.helpers.*
import com.simplemobiletools.calendar.pro.helpers.Formatter
import com.simplemobiletools.calendar.pro.models.Event
import com.simplemobiletools.calendar.pro.models.ListEvent
import com.simplemobiletools.calendar.pro.models.ListItem
import com.simplemobiletools.calendar.pro.models.ListSection
import com.simplemobiletools.commons.extensions.adjustAlpha
import com.simplemobiletools.commons.extensions.setBackgroundColor
import com.simplemobiletools.commons.extensions.setText
import com.simplemobiletools.commons.extensions.setTextSize
import com.simplemobiletools.calendar.pro.models.*
import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.helpers.LOWER_ALPHA
import com.simplemobiletools.commons.helpers.MEDIUM_ALPHA
import org.joda.time.DateTime
import java.util.*
class EventListWidgetAdapter(val context: Context) : RemoteViewsService.RemoteViewsFactory {
private val ITEM_EVENT = 0
private val ITEM_HEADER = 1
private val ITEM_SECTION_DAY = 1
private val ITEM_SECTION_MONTH = 2
private val allDayString = context.resources.getString(R.string.all_day)
private var events = ArrayList<ListItem>()
private var textColor = context.config.widgetTextColor
private var weakTextColor = textColor.adjustAlpha(LOWER_ALPHA)
private var weakTextColor = textColor.adjustAlpha(MEDIUM_ALPHA)
private val replaceDescription = context.config.replaceDescription
private val dimPastEvents = context.config.dimPastEvents
private var mediumFontSize = context.getWidgetFontSize()
override fun getViewAt(position: Int): RemoteViews? {
override fun getViewAt(position: Int): RemoteViews {
val type = getItemViewType(position)
val remoteView: RemoteViews
if (type == ITEM_EVENT) {
val event = events[position] as ListEvent
val layout = getItemViewLayout(event)
val layout = R.layout.event_list_item_widget
remoteView = RemoteViews(context.packageName, layout)
setupListEvent(remoteView, event)
} else {
remoteView = RemoteViews(context.packageName, R.layout.event_list_section_widget)
val section = events.getOrNull(position) as? ListSection
} else if (type == ITEM_SECTION_DAY) {
remoteView = RemoteViews(context.packageName, R.layout.event_list_section_day_widget)
val section = events.getOrNull(position) as? ListSectionDay
if (section != null) {
setupListSection(remoteView, section)
setupListSectionDay(remoteView, section)
}
} else {
remoteView = RemoteViews(context.packageName, R.layout.event_list_section_month_widget)
val section = events.getOrNull(position) as? ListSectionMonth
if (section != null) {
setupListSectionMonth(remoteView, section)
}
}
return remoteView
}
private fun getItemViewLayout(event: ListEvent): Int {
val detailField = if (replaceDescription) event.location else event.description
return if (detailField.isNotEmpty()) {
R.layout.event_list_item_widget
} else if (event.startTS == event.endTS) {
R.layout.event_list_item_widget_simple
} else if (event.isAllDay) {
val startCode = Formatter.getDayCodeFromTS(event.startTS)
val endCode = Formatter.getDayCodeFromTS(event.endTS)
if (startCode == endCode) {
R.layout.event_list_item_widget_simple
} else {
R.layout.event_list_item_widget
}
} else {
R.layout.event_list_item_widget
}
}
private fun setupListEvent(remoteView: RemoteViews, item: ListEvent) {
var curTextColor = textColor
remoteView.apply {
setText(R.id.event_item_title, item.title)
setText(R.id.event_item_description, if (replaceDescription) item.location else item.description)
setText(R.id.event_item_start, if (item.isAllDay) allDayString else Formatter.getTimeFromTS(context, item.startTS))
setBackgroundColor(R.id.event_item_color_bar, item.color)
setText(R.id.event_item_title, item.title)
if (item.startTS == item.endTS) {
setViewVisibility(R.id.event_item_end, View.INVISIBLE)
} else {
setViewVisibility(R.id.event_item_end, View.VISIBLE)
var endString = Formatter.getTimeFromTS(context, item.endTS)
val startCode = Formatter.getDayCodeFromTS(item.startTS)
val endCode = Formatter.getDayCodeFromTS(item.endTS)
val timeText = if (item.isAllDay) allDayString else Formatter.getTimeFromTS(context, item.startTS)
setText(R.id.event_item_time, timeText)
if (startCode != endCode) {
if (item.isAllDay) {
endString = Formatter.getDateFromCode(context, endCode, true)
} else {
endString += " (${Formatter.getDateFromCode(context, endCode, true)})"
}
} else if (item.isAllDay) {
setViewVisibility(R.id.event_item_end, View.INVISIBLE)
}
setText(R.id.event_item_end, endString)
// we cannot change the event_item_color_bar rules dynamically, so do it like this
val descriptionText = if (replaceDescription) item.location else item.description
if (descriptionText.isNotEmpty()) {
setText(R.id.event_item_time, "$timeText\n$descriptionText")
}
if (dimPastEvents && item.isPastEvent) {
@ -110,14 +76,10 @@ class EventListWidgetAdapter(val context: Context) : RemoteViewsService.RemoteVi
}
setTextColor(R.id.event_item_title, curTextColor)
setTextColor(R.id.event_item_description, curTextColor)
setTextColor(R.id.event_item_start, curTextColor)
setTextColor(R.id.event_item_end, curTextColor)
setTextColor(R.id.event_item_time, curTextColor)
setTextSize(R.id.event_item_title, mediumFontSize)
setTextSize(R.id.event_item_description, mediumFontSize)
setTextSize(R.id.event_item_start, mediumFontSize)
setTextSize(R.id.event_item_end, mediumFontSize)
setTextSize(R.id.event_item_time, mediumFontSize)
Intent().apply {
putExtra(EVENT_ID, item.id)
@ -127,7 +89,7 @@ class EventListWidgetAdapter(val context: Context) : RemoteViewsService.RemoteVi
}
}
private fun setupListSection(remoteView: RemoteViews, item: ListSection) {
private fun setupListSectionDay(remoteView: RemoteViews, item: ListSectionDay) {
var curTextColor = textColor
if (dimPastEvents && item.isPastSection) {
curTextColor = weakTextColor
@ -146,7 +108,19 @@ class EventListWidgetAdapter(val context: Context) : RemoteViewsService.RemoteVi
}
}
private fun getItemViewType(position: Int) = if (events.getOrNull(position) is ListEvent) ITEM_EVENT else ITEM_HEADER
private fun setupListSectionMonth(remoteView: RemoteViews, item: ListSectionMonth) {
val curTextColor = textColor
remoteView.apply {
setTextColor(event_section_title, curTextColor)
setText(event_section_title, item.title)
}
}
private fun getItemViewType(position: Int) = when {
events.getOrNull(position) is ListEvent -> ITEM_EVENT
events.getOrNull(position) is ListSectionDay -> ITEM_SECTION_DAY
else -> ITEM_SECTION_MONTH
}
override fun getLoadingView() = null
@ -180,20 +154,39 @@ class EventListWidgetAdapter(val context: Context) : RemoteViewsService.RemoteVi
}.thenBy { it.title }.thenBy { if (replaceDescription) it.location else it.description })
var prevCode = ""
var prevMonthLabel = ""
val now = getNowSeconds()
val today = Formatter.getDayTitle(context, Formatter.getDayCodeFromTS(now))
sorted.forEach {
val code = Formatter.getDayCodeFromTS(it.startTS)
val monthLabel = Formatter.getLongMonthYear(context, code)
if (monthLabel != prevMonthLabel) {
val listSectionMonth = ListSectionMonth(monthLabel)
listItems.add(listSectionMonth)
prevMonthLabel = monthLabel
}
if (code != prevCode) {
val day = Formatter.getDayTitle(context, code)
val day = Formatter.getDateDayTitle(code)
val isToday = day == today
val listSection = ListSection(day, code, isToday, !isToday && it.startTS < now)
val listSection = ListSectionDay(day, code, isToday, !isToday && it.startTS < now)
listItems.add(listSection)
prevCode = code
}
val listEvent = ListEvent(it.id!!, it.startTS, it.endTS, it.title, it.description, it.getIsAllDay(), it.color, it.location, it.isPastEvent, it.repeatInterval > 0)
val listEvent = ListEvent(
it.id!!,
it.startTS,
it.endTS,
it.title,
it.description,
it.getIsAllDay(),
it.color,
it.location,
it.isPastEvent,
it.repeatInterval > 0
)
listItems.add(listEvent)
}

View File

@ -6,7 +6,7 @@ import android.widget.RemoteViewsService
import com.simplemobiletools.calendar.pro.R
class EventListWidgetAdapterEmpty(val context: Context) : RemoteViewsService.RemoteViewsFactory {
override fun getViewAt(position: Int) = RemoteViews(context.packageName, R.layout.event_list_section_widget)
override fun getViewAt(position: Int) = RemoteViews(context.packageName, R.layout.event_list_section_day_widget)
override fun getLoadingView() = null

View File

@ -8,14 +8,12 @@ import com.simplemobiletools.calendar.pro.activities.SimpleActivity
import com.simplemobiletools.calendar.pro.extensions.config
import com.simplemobiletools.calendar.pro.models.EventType
import com.simplemobiletools.commons.extensions.getAdjustedPrimaryColor
import com.simplemobiletools.commons.extensions.getCornerRadius
import com.simplemobiletools.commons.extensions.setFillWithStroke
import kotlinx.android.synthetic.main.filter_event_type_view.view.*
import java.util.*
class FilterEventTypeAdapter(val activity: SimpleActivity, val eventTypes: List<EventType>, val displayEventTypes: Set<String>) :
RecyclerView.Adapter<FilterEventTypeAdapter.ViewHolder>() {
private val cornerRadius = activity.getCornerRadius()
RecyclerView.Adapter<FilterEventTypeAdapter.ViewHolder>() {
private val selectedKeys = HashSet<Long>()
init {
@ -57,7 +55,7 @@ class FilterEventTypeAdapter(val activity: SimpleActivity, val eventTypes: List<
filter_event_type_checkbox.isChecked = isSelected
filter_event_type_checkbox.setColors(activity.config.textColor, activity.getAdjustedPrimaryColor(), activity.config.backgroundColor)
filter_event_type_checkbox.text = eventType.getDisplayTitle()
filter_event_type_color.setFillWithStroke(eventType.color, activity.config.backgroundColor, cornerRadius)
filter_event_type_color.setFillWithStroke(eventType.color, activity.config.backgroundColor)
filter_event_type_holder.setOnClickListener { viewClicked(!isSelected, eventType) }
}

View File

@ -13,7 +13,6 @@ import com.simplemobiletools.calendar.pro.models.EventType
import com.simplemobiletools.commons.adapters.MyRecyclerViewAdapter
import com.simplemobiletools.commons.dialogs.ConfirmationDialog
import com.simplemobiletools.commons.dialogs.RadioGroupDialog
import com.simplemobiletools.commons.extensions.getCornerRadius
import com.simplemobiletools.commons.extensions.setFillWithStroke
import com.simplemobiletools.commons.extensions.toast
import com.simplemobiletools.commons.models.RadioItem
@ -21,10 +20,10 @@ import com.simplemobiletools.commons.views.MyRecyclerView
import kotlinx.android.synthetic.main.item_event_type.view.*
import java.util.*
class ManageEventTypesAdapter(activity: SimpleActivity, val eventTypes: ArrayList<EventType>, val listener: DeleteEventTypesListener?, recyclerView: MyRecyclerView,
itemClick: (Any) -> Unit) : MyRecyclerViewAdapter(activity, recyclerView, null, itemClick) {
private val cornerRadius = activity.getCornerRadius()
class ManageEventTypesAdapter(
activity: SimpleActivity, val eventTypes: ArrayList<EventType>, val listener: DeleteEventTypesListener?, recyclerView: MyRecyclerView,
itemClick: (Any) -> Unit
) : MyRecyclerViewAdapter(activity, recyclerView, null, itemClick) {
init {
setupDragListener(true)
}
@ -71,7 +70,7 @@ class ManageEventTypesAdapter(activity: SimpleActivity, val eventTypes: ArrayLis
view.apply {
event_item_frame.isSelected = selectedKeys.contains(eventType.id?.toInt())
event_type_title.text = eventType.getDisplayTitle()
event_type_color.setFillWithStroke(eventType.color, activity.config.backgroundColor, cornerRadius)
event_type_color.setFillWithStroke(eventType.color, activity.config.backgroundColor)
event_type_title.setTextColor(textColor)
}
}

View File

@ -56,7 +56,7 @@ class EditEventTypeDialog(val activity: Activity, var eventType: EventType? = nu
}
private fun setupColor(view: ImageView) {
view.setFillWithStroke(eventType!!.color, activity.config.backgroundColor, activity.getCornerRadius())
view.setFillWithStroke(eventType!!.color, activity.config.backgroundColor)
}
private fun eventTypeConfirmed(title: String, dialog: AlertDialog) {

View File

@ -1,7 +1,6 @@
package com.simplemobiletools.calendar.pro.dialogs
import android.view.ViewGroup
import android.widget.LinearLayout
import androidx.appcompat.app.AlertDialog
import com.simplemobiletools.calendar.pro.R
import com.simplemobiletools.calendar.pro.activities.SimpleActivity
@ -15,8 +14,10 @@ import kotlinx.android.synthetic.main.dialog_export_events.view.*
import java.io.File
import java.util.*
class ExportEventsDialog(val activity: SimpleActivity, val path: String, val hidePath: Boolean,
val callback: (file: File, eventTypes: ArrayList<Long>) -> Unit) {
class ExportEventsDialog(
val activity: SimpleActivity, val path: String, val hidePath: Boolean,
val callback: (file: File, eventTypes: ArrayList<Long>) -> Unit
) {
private var realPath = if (path.isEmpty()) activity.internalStoragePath else path
val config = activity.config
@ -24,7 +25,10 @@ class ExportEventsDialog(val activity: SimpleActivity, val path: String, val hid
val view = (activity.layoutInflater.inflate(R.layout.dialog_export_events, null) as ViewGroup).apply {
export_events_folder.text = activity.humanizePath(realPath)
export_events_filename.setText("${activity.getString(R.string.events)}_${activity.getCurrentFormattedDateTime()}")
export_events_checkbox.isChecked = config.exportPastEvents
export_past_events_checkbox.isChecked = config.exportPastEvents
export_past_events_checkbox_holder.setOnClickListener {
export_past_events_checkbox.toggle()
}
if (hidePath) {
export_events_folder_label.beGone()
@ -46,42 +50,39 @@ class ExportEventsDialog(val activity: SimpleActivity, val path: String, val hid
export_events_types_list.adapter = FilterEventTypeAdapter(activity, it, eventTypes)
if (it.size > 1) {
export_events_pick_types.beVisible()
val margin = activity.resources.getDimension(R.dimen.normal_margin).toInt()
(export_events_checkbox.layoutParams as LinearLayout.LayoutParams).leftMargin = margin
}
}
}
AlertDialog.Builder(activity)
.setPositiveButton(R.string.ok, null)
.setNegativeButton(R.string.cancel, null)
.create().apply {
activity.setupDialogStuff(view, this, R.string.export_events) {
getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener {
val filename = view.export_events_filename.value
when {
filename.isEmpty() -> activity.toast(R.string.empty_name)
filename.isAValidFilename() -> {
val file = File(realPath, "$filename.ics")
if (!hidePath && file.exists()) {
activity.toast(R.string.name_taken)
return@setOnClickListener
}
ensureBackgroundThread {
config.lastExportPath = file.absolutePath.getParentPath()
config.exportPastEvents = view.export_events_checkbox.isChecked
val eventTypes = (view.export_events_types_list.adapter as FilterEventTypeAdapter).getSelectedItemsList()
callback(file, eventTypes)
dismiss()
}
.setPositiveButton(R.string.ok, null)
.setNegativeButton(R.string.cancel, null)
.create().apply {
activity.setupDialogStuff(view, this, R.string.export_events) {
getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener {
val filename = view.export_events_filename.value
when {
filename.isEmpty() -> activity.toast(R.string.empty_name)
filename.isAValidFilename() -> {
val file = File(realPath, "$filename.ics")
if (!hidePath && file.exists()) {
activity.toast(R.string.name_taken)
return@setOnClickListener
}
ensureBackgroundThread {
config.lastExportPath = file.absolutePath.getParentPath()
config.exportPastEvents = view.export_past_events_checkbox.isChecked
val eventTypes = (view.export_events_types_list.adapter as FilterEventTypeAdapter).getSelectedItemsList()
callback(file, eventTypes)
dismiss()
}
else -> activity.toast(R.string.invalid_name)
}
else -> activity.toast(R.string.invalid_name)
}
}
}
}
}
}

View File

@ -8,9 +8,11 @@ import com.simplemobiletools.calendar.pro.extensions.config
import com.simplemobiletools.calendar.pro.extensions.eventTypesDB
import com.simplemobiletools.calendar.pro.extensions.eventsHelper
import com.simplemobiletools.calendar.pro.helpers.IcsImporter
import com.simplemobiletools.calendar.pro.helpers.IcsImporter.ImportResult.*
import com.simplemobiletools.calendar.pro.helpers.IcsImporter.ImportResult.IMPORT_FAIL
import com.simplemobiletools.calendar.pro.helpers.IcsImporter.ImportResult.IMPORT_NOTHING_NEW
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.REGULAR_EVENT_TYPE_ID
import com.simplemobiletools.commons.extensions.getCornerRadius
import com.simplemobiletools.commons.extensions.setFillWithStroke
import com.simplemobiletools.commons.extensions.setupDialogStuff
import com.simplemobiletools.commons.extensions.toast
@ -61,25 +63,29 @@ class ImportEventsDialog(val activity: SimpleActivity, val path: String, val cal
updateEventType(this)
}
}
import_events_checkbox_holder.setOnClickListener {
import_events_checkbox.toggle()
}
}
AlertDialog.Builder(activity)
.setPositiveButton(R.string.ok, null)
.setNegativeButton(R.string.cancel, null)
.create().apply {
activity.setupDialogStuff(view, this, R.string.import_events) {
getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener {
getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener(null)
activity.toast(R.string.importing)
ensureBackgroundThread {
val overrideFileEventTypes = view.import_events_checkbox.isChecked
val result = IcsImporter(activity).importEvents(path, currEventTypeId, currEventTypeCalDAVCalendarId, overrideFileEventTypes)
handleParseResult(result)
dismiss()
}
.setPositiveButton(R.string.ok, null)
.setNegativeButton(R.string.cancel, null)
.create().apply {
activity.setupDialogStuff(view, this, R.string.import_events) {
getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener {
getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener(null)
activity.toast(R.string.importing)
ensureBackgroundThread {
val overrideFileEventTypes = view.import_events_checkbox.isChecked
val result = IcsImporter(activity).importEvents(path, currEventTypeId, currEventTypeCalDAVCalendarId, overrideFileEventTypes)
handleParseResult(result)
dismiss()
}
}
}
}
}
private fun updateEventType(view: ViewGroup) {
@ -87,18 +93,20 @@ class ImportEventsDialog(val activity: SimpleActivity, val path: String, val cal
val eventType = activity.eventTypesDB.getEventTypeWithId(currEventTypeId)
activity.runOnUiThread {
view.import_event_type_title.text = eventType!!.getDisplayTitle()
view.import_event_type_color.setFillWithStroke(eventType.color, activity.config.backgroundColor, activity.getCornerRadius())
view.import_event_type_color.setFillWithStroke(eventType.color, activity.config.backgroundColor)
}
}
}
private fun handleParseResult(result: IcsImporter.ImportResult) {
activity.toast(when (result) {
IMPORT_NOTHING_NEW -> R.string.no_new_items
IMPORT_OK -> R.string.importing_successful
IMPORT_PARTIAL -> R.string.importing_some_entries_failed
else -> R.string.no_items_found
})
activity.toast(
when (result) {
IMPORT_NOTHING_NEW -> R.string.no_new_items
IMPORT_OK -> R.string.importing_successful
IMPORT_PARTIAL -> R.string.importing_some_entries_failed
else -> R.string.no_items_found
}
)
callback(result != IMPORT_FAIL)
}
}

View File

@ -11,7 +11,6 @@ import com.simplemobiletools.calendar.pro.extensions.config
import com.simplemobiletools.calendar.pro.extensions.eventsHelper
import com.simplemobiletools.calendar.pro.helpers.STORED_LOCALLY_ONLY
import com.simplemobiletools.calendar.pro.models.CalDAVCalendar
import com.simplemobiletools.commons.extensions.getCornerRadius
import com.simplemobiletools.commons.extensions.setFillWithStroke
import com.simplemobiletools.commons.extensions.setupDialogStuff
import com.simplemobiletools.commons.extensions.updateTextColors
@ -47,9 +46,9 @@ class SelectEventCalendarDialog(val activity: Activity, val calendars: List<CalD
}
dialog = AlertDialog.Builder(activity)
.create().apply {
activity.setupDialogStuff(view, this)
}
.create().apply {
activity.setupDialogStuff(view, this)
}
}
private fun addRadioButton(title: String, typeId: Int, color: Int) {
@ -61,7 +60,7 @@ class SelectEventCalendarDialog(val activity: Activity, val calendars: List<CalD
}
if (typeId != STORED_LOCALLY_ONLY) {
view.dialog_radio_color.setFillWithStroke(color, activity.config.backgroundColor, activity.getCornerRadius())
view.dialog_radio_color.setFillWithStroke(color, activity.config.backgroundColor)
}
view.setOnClickListener { viewClicked(typeId) }

View File

@ -10,7 +10,6 @@ import com.simplemobiletools.calendar.pro.extensions.calDAVHelper
import com.simplemobiletools.calendar.pro.extensions.config
import com.simplemobiletools.calendar.pro.models.EventType
import com.simplemobiletools.commons.dialogs.ColorPickerDialog
import com.simplemobiletools.commons.extensions.getCornerRadius
import com.simplemobiletools.commons.extensions.setFillWithStroke
import com.simplemobiletools.commons.extensions.setupDialogStuff
import kotlinx.android.synthetic.main.dialog_select_event_type_color.view.*
@ -52,7 +51,7 @@ class SelectEventTypeColorDialog(val activity: Activity, val eventType: EventTyp
id = colorKey
}
view.dialog_radio_color.setFillWithStroke(color, activity.config.backgroundColor, activity.getCornerRadius())
view.dialog_radio_color.setFillWithStroke(color, activity.config.backgroundColor)
view.setOnClickListener {
viewClicked(colorKey)
}

View File

@ -9,14 +9,19 @@ import com.simplemobiletools.calendar.pro.R
import com.simplemobiletools.calendar.pro.extensions.config
import com.simplemobiletools.calendar.pro.extensions.eventsHelper
import com.simplemobiletools.calendar.pro.models.EventType
import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.extensions.hideKeyboard
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 kotlinx.android.synthetic.main.dialog_select_radio_group.view.*
import kotlinx.android.synthetic.main.radio_button_with_color.view.*
import java.util.*
class SelectEventTypeDialog(val activity: Activity, val currEventType: Long, val showCalDAVCalendars: Boolean, val showNewEventTypeOption: Boolean,
val addLastUsedOneAsFirstOption: Boolean, val showOnlyWritable: Boolean, val callback: (eventType: EventType) -> Unit) {
class SelectEventTypeDialog(
val activity: Activity, val currEventType: Long, val showCalDAVCalendars: Boolean, val showNewEventTypeOption: Boolean,
val addLastUsedOneAsFirstOption: Boolean, val showOnlyWritable: Boolean, val callback: (eventType: EventType) -> Unit
) {
private val NEW_EVENT_TYPE_ID = -2L
private val LAST_USED_EVENT_TYPE_ID = -1L
@ -49,9 +54,9 @@ class SelectEventTypeDialog(val activity: Activity, val currEventType: Long, val
}
dialog = AlertDialog.Builder(activity)
.create().apply {
activity.setupDialogStuff(view, this)
}
.create().apply {
activity.setupDialogStuff(view, this)
}
}
private fun addRadioButton(eventType: EventType) {
@ -63,7 +68,7 @@ class SelectEventTypeDialog(val activity: Activity, val currEventType: Long, val
}
if (eventType.color != Color.TRANSPARENT) {
view.dialog_radio_color.setFillWithStroke(eventType.color, activity.config.backgroundColor, activity.getCornerRadius())
view.dialog_radio_color.setFillWithStroke(eventType.color, activity.config.backgroundColor)
}
view.setOnClickListener { viewClicked(eventType) }

View File

@ -436,7 +436,7 @@ fun Context.addDayNumber(rawTextColor: Int, day: DayMonthly, linearLayout: Linea
}
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_vector)
fun Context.addDayEvents(day: DayMonthly, linearLayout: LinearLayout, res: Resources, dividerMargin: Int) {
val eventLayoutParams = LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
@ -475,7 +475,7 @@ fun Context.addDayEvents(day: DayMonthly, linearLayout: LinearLayout, res: Resou
}
}
fun Context.getEventListItems(events: List<Event>, addSections: Boolean = true): ArrayList<ListItem> {
fun Context.getEventListItems(events: List<Event>, addSectionDays: Boolean = true, addSectionMonths: Boolean = true): ArrayList<ListItem> {
val listItems = ArrayList<ListItem>(events.size)
val replaceDescription = config.replaceDescription
@ -495,19 +495,31 @@ fun Context.getEventListItems(events: List<Event>, addSections: Boolean = true):
}.thenBy { it.title }.thenBy { if (replaceDescription) it.location else it.description })
var prevCode = ""
var prevMonthLabel = ""
val now = getNowSeconds()
val today = Formatter.getDayTitle(this, Formatter.getDayCodeFromTS(now))
val todayCode = Formatter.getDayCodeFromTS(now)
sorted.forEach {
val code = Formatter.getDayCodeFromTS(it.startTS)
if (code != prevCode && addSections) {
val day = Formatter.getDayTitle(this, code)
val isToday = day == today
val listSection = ListSection(day, code, isToday, !isToday && it.startTS < now)
listItems.add(listSection)
if (addSectionMonths) {
val monthLabel = Formatter.getLongMonthYear(this, code)
if (monthLabel != prevMonthLabel) {
val listSectionMonth = ListSectionMonth(monthLabel)
listItems.add(listSectionMonth)
prevMonthLabel = monthLabel
}
}
if (code != prevCode && addSectionDays) {
val day = Formatter.getDateDayTitle(code)
val isToday = code == todayCode
val listSectionDay = ListSectionDay(day, code, isToday, !isToday && it.startTS < now)
listItems.add(listSectionDay)
prevCode = code
}
val listEvent = ListEvent(it.id!!, it.startTS, it.endTS, it.title, it.description, it.getIsAllDay(), it.color, it.location, it.isPastEvent, it.repeatInterval > 0)
val listEvent =
ListEvent(it.id!!, it.startTS, it.endTS, it.title, it.description, it.getIsAllDay(), it.color, it.location, it.isPastEvent, it.repeatInterval > 0)
listItems.add(listEvent)
}
return listItems

View File

@ -1,15 +1,14 @@
package com.simplemobiletools.calendar.pro.extensions
import android.content.res.Resources
import android.graphics.Bitmap
import android.graphics.drawable.BitmapDrawable
import android.widget.TextView
import androidx.core.graphics.drawable.toBitmap
import com.simplemobiletools.commons.extensions.applyColorFilter
fun TextView.addResizedBackgroundDrawable(res: Resources, drawableHeight: Int, primaryColor: Int, drawableId: Int) {
val baseDrawable = res.getDrawable(drawableId)
val bitmap = (baseDrawable as BitmapDrawable).bitmap
val scaledDrawable = BitmapDrawable(res, Bitmap.createScaledBitmap(bitmap, drawableHeight, drawableHeight, true))
val baseDrawable = res.getDrawable(drawableId).toBitmap(drawableHeight, drawableHeight)
val scaledDrawable = BitmapDrawable(res, baseDrawable)
scaledDrawable.applyColorFilter(primaryColor)
background = scaledDrawable
}

View File

@ -24,6 +24,7 @@ import com.simplemobiletools.calendar.pro.helpers.Formatter
import com.simplemobiletools.calendar.pro.interfaces.NavigationListener
import com.simplemobiletools.calendar.pro.models.Event
import com.simplemobiletools.commons.extensions.applyColorFilter
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.*
@ -42,7 +43,7 @@ class DayFragment : Fragment() {
val view = inflater.inflate(R.layout.fragment_day, container, false)
mHolder = view.day_holder
mDayCode = arguments!!.getString(DAY_CODE)!!
mDayCode = requireArguments().getString(DAY_CODE)!!
setupButtons()
return view
}
@ -53,7 +54,7 @@ class DayFragment : Fragment() {
}
private fun setupButtons() {
mTextColor = context!!.config.textColor
mTextColor = requireContext().config.textColor
mHolder.top_left_arrow.apply {
applyColorFilter(mTextColor)
@ -62,7 +63,7 @@ class DayFragment : Fragment() {
mListener?.goLeft()
}
val pointerLeft = context!!.getDrawable(R.drawable.ic_chevron_left_vector)
val pointerLeft = requireContext().getDrawable(R.drawable.ic_chevron_left_vector)
pointerLeft?.isAutoMirrored = true
setImageDrawable(pointerLeft)
}
@ -74,12 +75,12 @@ class DayFragment : Fragment() {
mListener?.goRight()
}
val pointerRight = context!!.getDrawable(R.drawable.ic_chevron_right_vector)
val pointerRight = requireContext().getDrawable(R.drawable.ic_chevron_right_vector)
pointerRight?.isAutoMirrored = true
setImageDrawable(pointerRight)
}
val day = Formatter.getDayTitle(context!!, mDayCode)
val day = Formatter.getDayTitle(requireContext(), mDayCode)
mHolder.top_value.apply {
text = day
contentDescription = text
@ -105,7 +106,7 @@ class DayFragment : Fragment() {
}
lastHash = newHash
val replaceDescription = context!!.config.replaceDescription
val replaceDescription = requireContext().config.replaceDescription
val sorted = ArrayList(events.sortedWith(compareBy({ !it.getIsAllDay() }, { it.startTS }, { it.endTS }, { it.title }, {
if (replaceDescription) it.location else it.description
})))
@ -124,7 +125,10 @@ class DayFragment : Fragment() {
}.apply {
mHolder.day_events.adapter = this
}
mHolder.day_events.scheduleLayoutAnimation()
if (requireContext().areSystemAnimationsEnabled) {
mHolder.day_events.scheduleLayoutAnimation()
}
}
private fun editEvent(event: Event) {
@ -143,12 +147,12 @@ class DayFragment : Fragment() {
(day_events.adapter as? DayEventsAdapter)?.togglePrintMode()
Handler().postDelayed({
context!!.printBitmap(day_holder.getViewBitmap())
requireContext().printBitmap(day_holder.getViewBitmap())
Handler().postDelayed({
top_left_arrow.beVisible()
top_right_arrow.beVisible()
top_value.setTextColor(context!!.config.textColor)
top_value.setTextColor(requireContext().config.textColor)
(day_events.adapter as? DayEventsAdapter)?.togglePrintMode()
}, 1000)
}, 1000)

View File

@ -40,7 +40,7 @@ class DayFragmentsHolder : MyFragmentHolder(), NavigationListener {
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
val view = inflater.inflate(R.layout.fragment_days_holder, container, false)
view.background = ColorDrawable(context!!.config.backgroundColor)
view.background = ColorDrawable(requireContext().config.backgroundColor)
viewPager = view.fragment_days_viewpager
viewPager!!.id = (System.currentTimeMillis() % 100000).toInt()
setupFragment()
@ -49,7 +49,7 @@ class DayFragmentsHolder : MyFragmentHolder(), NavigationListener {
private fun setupFragment() {
val codes = getDays(currentDayCode)
val dailyAdapter = MyDayPagerAdapter(activity!!.supportFragmentManager, codes, this)
val dailyAdapter = MyDayPagerAdapter(requireActivity().supportFragmentManager, codes, this)
defaultDailyPage = codes.size / 2
@ -104,19 +104,19 @@ class DayFragmentsHolder : MyFragmentHolder(), NavigationListener {
}
override fun showGoToDateDialog() {
activity!!.setTheme(context!!.getDialogTheme())
requireActivity().setTheme(requireContext().getDialogTheme())
val view = layoutInflater.inflate(R.layout.date_picker, null)
val datePicker = view.findViewById<DatePicker>(R.id.date_picker)
val dateTime = Formatter.getDateTimeFromCode(currentDayCode)
datePicker.init(dateTime.year, dateTime.monthOfYear - 1, dateTime.dayOfMonth, null)
AlertDialog.Builder(context!!)
.setNegativeButton(R.string.cancel, null)
.setPositiveButton(R.string.ok) { dialog, which -> dateSelected(dateTime, datePicker) }
.create().apply {
activity?.setupDialogStuff(view, this)
}
AlertDialog.Builder(requireContext())
.setNegativeButton(R.string.cancel, null)
.setPositiveButton(R.string.ok) { dialog, which -> dateSelected(dateTime, datePicker) }
.create().apply {
activity?.setupDialogStuff(view, this)
}
}
private fun dateSelected(dateTime: DateTime, datePicker: DatePicker) {

View File

@ -17,7 +17,7 @@ import com.simplemobiletools.calendar.pro.helpers.Formatter
import com.simplemobiletools.calendar.pro.models.Event
import com.simplemobiletools.calendar.pro.models.ListEvent
import com.simplemobiletools.calendar.pro.models.ListItem
import com.simplemobiletools.calendar.pro.models.ListSection
import com.simplemobiletools.calendar.pro.models.ListSectionDay
import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.helpers.MONTH_SECONDS
import com.simplemobiletools.commons.interfaces.RefreshRecyclerViewListener
@ -48,7 +48,7 @@ class EventListFragment : MyFragmentHolder(), RefreshRecyclerViewListener {
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
mView = inflater.inflate(R.layout.fragment_event_list, container, false)
mView.background = ColorDrawable(context!!.config.backgroundColor)
mView.background = ColorDrawable(requireContext().config.backgroundColor)
mView.calendar_events_list_holder?.id = (System.currentTimeMillis() % 100000).toInt()
mView.calendar_empty_list_placeholder_2.apply {
setTextColor(context.getAdjustedPrimaryColor())
@ -58,7 +58,7 @@ class EventListFragment : MyFragmentHolder(), RefreshRecyclerViewListener {
}
}
use24HourFormat = context!!.config.use24HourFormat
use24HourFormat = requireContext().config.use24HourFormat
updateActionBarTitle()
return mView
}
@ -66,7 +66,7 @@ class EventListFragment : MyFragmentHolder(), RefreshRecyclerViewListener {
override fun onResume() {
super.onResume()
checkEvents()
val use24Hour = context!!.config.use24HourFormat
val use24Hour = requireContext().config.use24HourFormat
if (use24Hour != use24HourFormat) {
use24HourFormat = use24Hour
(mView.calendar_events_list.adapter as? EventListAdapter)?.toggle24HourFormat(use24HourFormat)
@ -75,23 +75,24 @@ class EventListFragment : MyFragmentHolder(), RefreshRecyclerViewListener {
override fun onPause() {
super.onPause()
use24HourFormat = context!!.config.use24HourFormat
use24HourFormat = requireContext().config.use24HourFormat
}
private fun checkEvents() {
if (!wereInitialEventsAdded) {
minFetchedTS = DateTime().minusMinutes(context!!.config.displayPastEvents).seconds()
minFetchedTS = DateTime().minusMinutes(requireContext().config.displayPastEvents).seconds()
maxFetchedTS = DateTime().plusMonths(6).seconds()
}
context!!.eventsHelper.getEvents(minFetchedTS, maxFetchedTS) {
requireContext().eventsHelper.getEvents(minFetchedTS, maxFetchedTS) {
if (it.size >= MIN_EVENTS_TRESHOLD) {
receivedEvents(it, NOT_UPDATING)
} else {
if (!wereInitialEventsAdded) {
maxFetchedTS += FETCH_INTERVAL
}
context!!.eventsHelper.getEvents(minFetchedTS, maxFetchedTS) {
requireContext().eventsHelper.getEvents(minFetchedTS, maxFetchedTS) {
mEvents = it
receivedEvents(mEvents, NOT_UPDATING, !wereInitialEventsAdded)
}
@ -106,7 +107,7 @@ class EventListFragment : MyFragmentHolder(), RefreshRecyclerViewListener {
}
mEvents = events
val listItems = context!!.getEventListItems(mEvents)
val listItems = requireContext().getEventListItems(mEvents)
activity?.runOnUiThread {
if (activity == null) {
@ -123,7 +124,10 @@ class EventListFragment : MyFragmentHolder(), RefreshRecyclerViewListener {
mView.calendar_events_list.adapter = this
}
mView.calendar_events_list.scheduleLayoutAnimation()
if (requireContext().areSystemAnimationsEnabled) {
mView.calendar_events_list.scheduleLayoutAnimation()
}
mView.calendar_events_list.endlessScrollListener = object : MyRecyclerView.EndlessScrollListener {
override fun updateTop() {
fetchPreviousPeriod()
@ -151,7 +155,7 @@ class EventListFragment : MyFragmentHolder(), RefreshRecyclerViewListener {
mView.calendar_events_list.scrollToPosition(item)
}
} else if (updateStatus == UPDATE_BOTTOM) {
mView.calendar_events_list.smoothScrollBy(0, context!!.resources.getDimension(R.dimen.endless_scroll_move_height).toInt())
mView.calendar_events_list.smoothScrollBy(0, requireContext().resources.getDimension(R.dimen.endless_scroll_move_height).toInt())
}
}
checkPlaceholderVisibility()
@ -163,7 +167,7 @@ class EventListFragment : MyFragmentHolder(), RefreshRecyclerViewListener {
mView.calendar_empty_list_placeholder_2.beVisibleIf(mEvents.isEmpty())
mView.calendar_events_list.beGoneIf(mEvents.isEmpty())
if (activity != null)
mView.calendar_empty_list_placeholder.setTextColor(activity!!.config.textColor)
mView.calendar_empty_list_placeholder.setTextColor(requireActivity().config.textColor)
}
private fun fetchPreviousPeriod() {
@ -172,7 +176,7 @@ class EventListFragment : MyFragmentHolder(), RefreshRecyclerViewListener {
val oldMinFetchedTS = minFetchedTS - 1
minFetchedTS -= FETCH_INTERVAL
context!!.eventsHelper.getEvents(minFetchedTS, oldMinFetchedTS) {
requireContext().eventsHelper.getEvents(minFetchedTS, oldMinFetchedTS) {
mEvents.addAll(0, it)
receivedEvents(mEvents, UPDATE_TOP)
}
@ -181,7 +185,7 @@ class EventListFragment : MyFragmentHolder(), RefreshRecyclerViewListener {
private fun fetchNextPeriod() {
val oldMaxFetchedTS = maxFetchedTS + 1
maxFetchedTS += FETCH_INTERVAL
context!!.eventsHelper.getEvents(oldMaxFetchedTS, maxFetchedTS) {
requireContext().eventsHelper.getEvents(oldMaxFetchedTS, maxFetchedTS) {
mEvents.addAll(it)
receivedEvents(mEvents, UPDATE_BOTTOM)
}
@ -192,8 +196,8 @@ class EventListFragment : MyFragmentHolder(), RefreshRecyclerViewListener {
}
override fun goToToday() {
val listItems = context!!.getEventListItems(mEvents)
val firstNonPastSectionIndex = listItems.indexOfFirst { it is ListSection && !it.isPastSection }
val listItems = requireContext().getEventListItems(mEvents)
val firstNonPastSectionIndex = listItems.indexOfFirst { it is ListSectionDay && !it.isPastSection }
if (firstNonPastSectionIndex != -1) {
(mView.calendar_events_list.layoutManager as LinearLayoutManager).scrollToPositionWithOffset(firstNonPastSectionIndex, 0)
mView.calendar_events_list.onGlobalLayout {
@ -226,7 +230,7 @@ class EventListFragment : MyFragmentHolder(), RefreshRecyclerViewListener {
(calendar_events_list.adapter as? EventListAdapter)?.togglePrintMode()
Handler().postDelayed({
context!!.printBitmap(calendar_events_list.getViewBitmap())
requireContext().printBitmap(calendar_events_list.getViewBitmap())
Handler().postDelayed({
(calendar_events_list.adapter as? EventListAdapter)?.togglePrintMode()

View File

@ -23,6 +23,7 @@ import com.simplemobiletools.calendar.pro.interfaces.NavigationListener
import com.simplemobiletools.calendar.pro.models.DayMonthly
import com.simplemobiletools.calendar.pro.models.Event
import com.simplemobiletools.calendar.pro.models.ListEvent
import com.simplemobiletools.commons.extensions.areSystemAnimationsEnabled
import com.simplemobiletools.commons.extensions.beVisibleIf
import com.simplemobiletools.commons.interfaces.RefreshRecyclerViewListener
import kotlinx.android.synthetic.main.fragment_month_day.*
@ -48,9 +49,9 @@ class MonthDayFragment : Fragment(), MonthlyCalendar, RefreshRecyclerViewListene
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
val view = inflater.inflate(R.layout.fragment_month_day, container, false)
mRes = resources
mPackageName = activity!!.packageName
mPackageName = requireActivity().packageName
mHolder = view.month_day_calendar_holder
mDayCode = arguments!!.getString(DAY_CODE)!!
mDayCode = requireArguments().getString(DAY_CODE)!!
val shownMonthDateTime = Formatter.getDateTimeFromCode(mDayCode)
mHolder.month_day_selected_day_label.apply {
@ -60,10 +61,10 @@ class MonthDayFragment : Fragment(), MonthlyCalendar, RefreshRecyclerViewListene
}
}
mConfig = context!!.config
mConfig = requireContext().config
storeStateVariables()
setupButtons()
mCalendar = MonthlyCalendarImpl(this, context!!)
mCalendar = MonthlyCalendarImpl(this, requireContext())
return view
}
@ -134,9 +135,9 @@ class MonthDayFragment : Fragment(), MonthlyCalendar, RefreshRecyclerViewListene
}
}
val listItems = activity!!.getEventListItems(filtered, false)
val listItems = requireActivity().getEventListItems(filtered, mSelectedDayCode.isEmpty(), false)
if (mSelectedDayCode.isNotEmpty()) {
mHolder.month_day_selected_day_label.text = Formatter.getDateFromCode(activity!!, mSelectedDayCode, false)
mHolder.month_day_selected_day_label.text = Formatter.getDateFromCode(requireActivity(), mSelectedDayCode, false)
}
activity?.runOnUiThread {
@ -153,7 +154,10 @@ class MonthDayFragment : Fragment(), MonthlyCalendar, RefreshRecyclerViewListene
}.apply {
month_day_events_list.adapter = this
}
month_day_events_list.scheduleLayoutAnimation()
if (requireContext().areSystemAnimationsEnabled) {
month_day_events_list.scheduleLayoutAnimation()
}
} else {
(currAdapter as EventListAdapter).updateListItems(listItems)
}
@ -174,7 +178,7 @@ class MonthDayFragment : Fragment(), MonthlyCalendar, RefreshRecyclerViewListene
fun getNewEventDayCode() = if (mSelectedDayCode.isEmpty()) mDayCode else mSelectedDayCode
private fun getMonthLabel(shownMonthDateTime: DateTime): String {
var month = Formatter.getMonthName(activity!!, shownMonthDateTime.monthOfYear)
var month = Formatter.getMonthName(requireActivity(), shownMonthDateTime.monthOfYear)
val targetYear = shownMonthDateTime.toString(YEAR_PATTERN)
if (targetYear != DateTime().toString(YEAR_PATTERN)) {
month += " $targetYear"

View File

@ -42,7 +42,7 @@ class MonthDayFragmentsHolder : MyFragmentHolder(), NavigationListener {
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
val view = inflater.inflate(R.layout.fragment_months_days_holder, container, false)
view.background = ColorDrawable(context!!.config.backgroundColor)
view.background = ColorDrawable(requireContext().config.backgroundColor)
viewPager = view.fragment_months_days_viewpager
viewPager!!.id = (System.currentTimeMillis() % 100000).toInt()
setupFragment()
@ -51,7 +51,7 @@ class MonthDayFragmentsHolder : MyFragmentHolder(), NavigationListener {
private fun setupFragment() {
val codes = getMonths(currentDayCode)
val monthlyDailyAdapter = MyMonthDayPagerAdapter(activity!!.supportFragmentManager, codes, this)
val monthlyDailyAdapter = MyMonthDayPagerAdapter(requireActivity().supportFragmentManager, codes, this)
defaultMonthlyPage = codes.size / 2
viewPager!!.apply {
@ -106,7 +106,7 @@ class MonthDayFragmentsHolder : MyFragmentHolder(), NavigationListener {
}
override fun showGoToDateDialog() {
activity!!.setTheme(context!!.getDialogTheme())
requireActivity().setTheme(requireContext().getDialogTheme())
val view = layoutInflater.inflate(R.layout.date_picker, null)
val datePicker = view.findViewById<DatePicker>(R.id.date_picker)
datePicker.findViewById<View>(Resources.getSystem().getIdentifier("day", "id", "android")).beGone()
@ -114,7 +114,7 @@ class MonthDayFragmentsHolder : MyFragmentHolder(), NavigationListener {
val dateTime = DateTime(Formatter.getDateTimeFromCode(currentDayCode).toString())
datePicker.init(dateTime.year, dateTime.monthOfYear - 1, 1, null)
AlertDialog.Builder(context!!)
AlertDialog.Builder(requireContext())
.setNegativeButton(R.string.cancel, null)
.setPositiveButton(R.string.ok) { dialog, which -> datePicked(dateTime, datePicker) }
.create().apply {

View File

@ -45,14 +45,14 @@ class MonthFragment : Fragment(), MonthlyCalendar {
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
val view = inflater.inflate(R.layout.fragment_month, container, false)
mRes = resources
mPackageName = activity!!.packageName
mPackageName = requireActivity().packageName
mHolder = view.month_calendar_holder
mDayCode = arguments!!.getString(DAY_CODE)!!
mConfig = context!!.config
mDayCode = requireArguments().getString(DAY_CODE)!!
mConfig = requireContext().config
storeStateVariables()
setupButtons()
mCalendar = MonthlyCalendarImpl(this, context!!)
mCalendar = MonthlyCalendarImpl(this, requireContext())
return view
}
@ -116,7 +116,7 @@ class MonthFragment : Fragment(), MonthlyCalendar {
listener?.goLeft()
}
val pointerLeft = context!!.getDrawable(R.drawable.ic_chevron_left_vector)
val pointerLeft = requireContext().getDrawable(R.drawable.ic_chevron_left_vector)
pointerLeft?.isAutoMirrored = true
setImageDrawable(pointerLeft)
}
@ -128,7 +128,7 @@ class MonthFragment : Fragment(), MonthlyCalendar {
listener?.goRight()
}
val pointerRight = context!!.getDrawable(R.drawable.ic_chevron_right_vector)
val pointerRight = requireContext().getDrawable(R.drawable.ic_chevron_right_vector)
pointerRight?.isAutoMirrored = true
setImageDrawable(pointerRight)
}
@ -154,7 +154,7 @@ class MonthFragment : Fragment(), MonthlyCalendar {
top_value.setTextColor(resources.getColor(R.color.theme_light_text_color))
month_view_wrapper.togglePrintMode()
context!!.printBitmap(month_calendar_holder.getViewBitmap())
requireContext().printBitmap(month_calendar_holder.getViewBitmap())
top_left_arrow.beVisible()
top_right_arrow.beVisible()

View File

@ -42,7 +42,7 @@ class MonthFragmentsHolder : MyFragmentHolder(), NavigationListener {
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
val view = inflater.inflate(R.layout.fragment_months_holder, container, false)
view.background = ColorDrawable(context!!.config.backgroundColor)
view.background = ColorDrawable(requireContext().config.backgroundColor)
viewPager = view.fragment_months_viewpager
viewPager!!.id = (System.currentTimeMillis() % 100000).toInt()
setupFragment()
@ -51,7 +51,7 @@ class MonthFragmentsHolder : MyFragmentHolder(), NavigationListener {
private fun setupFragment() {
val codes = getMonths(currentDayCode)
val monthlyAdapter = MyMonthPagerAdapter(activity!!.supportFragmentManager, codes, this)
val monthlyAdapter = MyMonthPagerAdapter(requireActivity().supportFragmentManager, codes, this)
defaultMonthlyPage = codes.size / 2
viewPager!!.apply {
@ -106,7 +106,7 @@ class MonthFragmentsHolder : MyFragmentHolder(), NavigationListener {
}
override fun showGoToDateDialog() {
activity!!.setTheme(context!!.getDialogTheme())
requireActivity().setTheme(requireContext().getDialogTheme())
val view = layoutInflater.inflate(R.layout.date_picker, null)
val datePicker = view.findViewById<DatePicker>(R.id.date_picker)
datePicker.findViewById<View>(Resources.getSystem().getIdentifier("day", "id", "android")).beGone()
@ -114,7 +114,7 @@ class MonthFragmentsHolder : MyFragmentHolder(), NavigationListener {
val dateTime = DateTime(Formatter.getDateTimeFromCode(currentDayCode).toString())
datePicker.init(dateTime.year, dateTime.monthOfYear - 1, 1, null)
AlertDialog.Builder(context!!)
AlertDialog.Builder(requireContext())
.setNegativeButton(R.string.cancel, null)
.setPositiveButton(R.string.ok) { dialog, which -> datePicked(dateTime, datePicker) }
.create().apply {

View File

@ -81,14 +81,14 @@ class WeekFragment : Fragment(), WeeklyCalendar {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
res = context!!.resources
config = context!!.config
rowHeight = context!!.getWeeklyViewItemHeight()
res = requireContext().resources
config = requireContext().config
rowHeight = requireContext().getWeeklyViewItemHeight()
defaultRowHeight = res.getDimension(R.dimen.weekly_view_row_height)
weekTimestamp = arguments!!.getLong(WEEK_START_TIMESTAMP)
weekTimestamp = requireArguments().getLong(WEEK_START_TIMESTAMP)
dimPastEvents = config.dimPastEvents
highlightWeekends = config.highlightWeekends
primaryColor = context!!.getAdjustedPrimaryColor()
primaryColor = requireContext().getAdjustedPrimaryColor()
allDayRows.add(HashSet())
}
@ -96,7 +96,7 @@ class WeekFragment : Fragment(), WeeklyCalendar {
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
this.inflater = inflater
val fullHeight = context!!.getWeeklyViewItemHeight().toInt() * 24
val fullHeight = requireContext().getWeeklyViewItemHeight().toInt() * 24
mView = inflater.inflate(R.layout.fragment_week, container, false).apply {
scrollView = week_events_scrollview
week_horizontal_grid_holder.layoutParams.height = fullHeight
@ -137,7 +137,7 @@ class WeekFragment : Fragment(), WeeklyCalendar {
override fun onResume() {
super.onResume()
context!!.eventsHelper.getEventTypes(activity!!, false) {
requireContext().eventsHelper.getEventTypes(requireActivity(), false) {
it.map {
eventTypeColors.put(it.id!!, it.color)
}
@ -180,7 +180,7 @@ class WeekFragment : Fragment(), WeeklyCalendar {
fun updateCalendar() {
if (context != null) {
WeeklyCalendarImpl(this, context!!).updateWeeklyCalendar(weekTimestamp)
WeeklyCalendarImpl(this, requireContext()).updateWeeklyCalendar(weekTimestamp)
}
}
@ -386,7 +386,7 @@ class WeekFragment : Fragment(), WeeklyCalendar {
lastHash = newHash
activity!!.runOnUiThread {
requireActivity().runOnUiThread {
if (context != null && activity != null && isAdded) {
val replaceDescription = config.replaceDescription
val sorted = events.sortedWith(
@ -506,7 +506,7 @@ class WeekFragment : Fragment(), WeeklyCalendar {
var backgroundColor = eventTypeColors.get(event.eventType, primaryColor)
var textColor = backgroundColor.getContrastColor()
if (dimPastEvents && event.isPastEvent && !isPrintVersion) {
backgroundColor = backgroundColor.adjustAlpha(LOWER_ALPHA)
backgroundColor = backgroundColor.adjustAlpha(MEDIUM_ALPHA)
textColor = textColor.adjustAlpha(HIGHER_ALPHA)
}

View File

@ -48,9 +48,9 @@ class WeekFragmentsHolder : MyFragmentHolder(), WeekFragmentListener {
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
weekHolder = inflater.inflate(R.layout.fragment_week_holder, container, false) as ViewGroup
weekHolder!!.background = ColorDrawable(context!!.config.backgroundColor)
weekHolder!!.background = ColorDrawable(requireContext().config.backgroundColor)
val itemHeight = context!!.getWeeklyViewItemHeight().toInt()
val itemHeight = requireContext().getWeeklyViewItemHeight().toInt()
weekHolder!!.week_view_hours_holder.setPadding(0, 0, 0, itemHeight)
viewPager = weekHolder!!.week_view_view_pager
@ -92,7 +92,7 @@ class WeekFragmentsHolder : MyFragmentHolder(), WeekFragmentListener {
private fun setupWeeklyViewPager() {
val weekTSs = getWeekTimestamps(currentWeekTS)
val weeklyAdapter = MyWeekPagerAdapter(activity!!.supportFragmentManager, weekTSs, this)
val weeklyAdapter = MyWeekPagerAdapter(requireActivity().supportFragmentManager, weekTSs, this)
defaultWeeklyPage = weekTSs.size / 2
@ -125,12 +125,12 @@ class WeekFragmentsHolder : MyFragmentHolder(), WeekFragmentListener {
})
}
private fun addHours(textColor: Int = context!!.config.textColor) {
val itemHeight = context!!.getWeeklyViewItemHeight().toInt()
private fun addHours(textColor: Int = requireContext().config.textColor) {
val itemHeight = requireContext().getWeeklyViewItemHeight().toInt()
weekHolder!!.week_view_hours_holder.removeAllViews()
val hourDateTime = DateTime().withDate(2000, 1, 1).withTime(0, 0, 0, 0)
for (i in 1..23) {
val formattedHours = Formatter.getHours(context!!, hourDateTime.withHourOfDay(i))
val formattedHours = Formatter.getHours(requireContext(), hourDateTime.withHourOfDay(i))
(layoutInflater.inflate(R.layout.weekly_view_hour_textview, null, false) as TextView).apply {
text = formattedHours
setTextColor(textColor)
@ -143,7 +143,7 @@ class WeekFragmentsHolder : MyFragmentHolder(), WeekFragmentListener {
private fun getWeekTimestamps(targetSeconds: Long): List<Long> {
val weekTSs = ArrayList<Long>(PREFILLED_WEEKS)
val dateTime = Formatter.getDateTimeFromTS(targetSeconds)
val shownWeekDays = context!!.config.weeklyViewDays
val shownWeekDays = requireContext().config.weeklyViewDays
var currentWeek = dateTime.minusDays(PREFILLED_WEEKS / 2 * shownWeekDays)
for (i in 0 until PREFILLED_WEEKS) {
weekTSs.add(currentWeek.seconds())
@ -155,7 +155,7 @@ class WeekFragmentsHolder : MyFragmentHolder(), WeekFragmentListener {
private fun setupWeeklyActionbarTitle(timestamp: Long) {
val startDateTime = Formatter.getDateTimeFromTS(timestamp)
val endDateTime = Formatter.getDateTimeFromTS(timestamp + WEEK_SECONDS)
val startMonthName = Formatter.getMonthName(context!!, startDateTime.monthOfYear)
val startMonthName = Formatter.getMonthName(requireContext(), startDateTime.monthOfYear)
if (startDateTime.monthOfYear == endDateTime.monthOfYear) {
var newTitle = startMonthName
if (startDateTime.year != DateTime().year) {
@ -163,7 +163,7 @@ class WeekFragmentsHolder : MyFragmentHolder(), WeekFragmentListener {
}
(activity as AppCompatActivity).updateActionBarTitle(newTitle)
} else {
val endMonthName = Formatter.getMonthName(context!!, endDateTime.monthOfYear)
val endMonthName = Formatter.getMonthName(requireContext(), endDateTime.monthOfYear)
(activity as AppCompatActivity).updateActionBarTitle("$startMonthName - $endMonthName")
}
(activity as AppCompatActivity).updateActionBarSubtitle("${getString(R.string.week)} ${startDateTime.plusDays(3).weekOfWeekyear}")
@ -175,14 +175,14 @@ class WeekFragmentsHolder : MyFragmentHolder(), WeekFragmentListener {
}
override fun showGoToDateDialog() {
activity!!.setTheme(context!!.getDialogTheme())
requireActivity().setTheme(requireContext().getDialogTheme())
val view = layoutInflater.inflate(R.layout.date_picker, null)
val datePicker = view.findViewById<DatePicker>(R.id.date_picker)
val dateTime = Formatter.getUTCDateTimeFromTS(currentWeekTS)
datePicker.init(dateTime.year, dateTime.monthOfYear - 1, dateTime.dayOfMonth, null)
AlertDialog.Builder(context!!)
AlertDialog.Builder(requireContext())
.setNegativeButton(R.string.cancel, null)
.setPositiveButton(R.string.ok) { dialog, which -> dateSelected(dateTime, datePicker) }
.create().apply {
@ -191,7 +191,7 @@ class WeekFragmentsHolder : MyFragmentHolder(), WeekFragmentListener {
}
private fun dateSelected(dateTime: DateTime, datePicker: DatePicker) {
val isSundayFirst = context!!.config.isSundayFirst
val isSundayFirst = requireContext().config.isSundayFirst
val month = datePicker.month + 1
val year = datePicker.year
val day = datePicker.dayOfMonth
@ -227,13 +227,13 @@ class WeekFragmentsHolder : MyFragmentHolder(), WeekFragmentListener {
}
private fun updateWeeklyViewDays(days: Int) {
context!!.config.weeklyViewDays = days
requireContext().config.weeklyViewDays = days
updateDaysCount(days)
setupWeeklyViewPager()
}
private fun updateDaysCount(cnt: Int) {
weekHolder!!.week_view_days_count.text = context!!.resources.getQuantityString(R.plurals.days, cnt, cnt)
weekHolder!!.week_view_days_count.text = requireContext().resources.getQuantityString(R.plurals.days, cnt, cnt)
}
override fun refreshEvents() {
@ -296,14 +296,14 @@ class WeekFragmentsHolder : MyFragmentHolder(), WeekFragmentListener {
(viewPager?.adapter as? MyWeekPagerAdapter)?.togglePrintMode(viewPager?.currentItem ?: 0)
Handler().postDelayed({
context!!.printBitmap(weekHolder!!.week_view_holder.getViewBitmap())
requireContext().printBitmap(weekHolder!!.week_view_holder.getViewBitmap())
Handler().postDelayed({
week_view_days_count_divider.beVisible()
week_view_seekbar.beVisible()
week_view_days_count.beVisible()
addHours()
background = ColorDrawable(context!!.config.backgroundColor)
background = ColorDrawable(requireContext().config.backgroundColor)
(viewPager?.adapter as? MyWeekPagerAdapter)?.togglePrintMode(viewPager?.currentItem ?: 0)
}, 1000)
}, 1000)

View File

@ -34,22 +34,22 @@ class YearFragment : Fragment(), YearlyCalendar {
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
mView = inflater.inflate(R.layout.fragment_year, container, false)
mYear = arguments!!.getInt(YEAR_LABEL)
context!!.updateTextColors(mView.calendar_holder)
mYear = requireArguments().getInt(YEAR_LABEL)
requireContext().updateTextColors(mView.calendar_holder)
setupMonths()
mCalendar = YearlyCalendarImpl(this, context!!, mYear)
mCalendar = YearlyCalendarImpl(this, requireContext(), mYear)
return mView
}
override fun onPause() {
super.onPause()
mSundayFirst = context!!.config.isSundayFirst
mSundayFirst = requireContext().config.isSundayFirst
}
override fun onResume() {
super.onResume()
val sundayFirst = context!!.config.isSundayFirst
val sundayFirst = requireContext().config.isSundayFirst
if (sundayFirst != mSundayFirst) {
mSundayFirst = sundayFirst
setupMonths()
@ -69,16 +69,16 @@ class YearFragment : Fragment(), YearlyCalendar {
val now = DateTime()
for (i in 1..12) {
val monthView = mView.findViewById<SmallMonthView>(resources.getIdentifier("month_$i", "id", context!!.packageName))
val monthView = mView.findViewById<SmallMonthView>(resources.getIdentifier("month_$i", "id", requireContext().packageName))
var dayOfWeek = dateTime.withMonthOfYear(i).dayOfWeek().get()
if (!mSundayFirst) {
dayOfWeek--
}
val monthLabel = mView.findViewById<TextView>(resources.getIdentifier("month_${i}_label", "id", context!!.packageName))
val monthLabel = mView.findViewById<TextView>(resources.getIdentifier("month_${i}_label", "id", requireContext().packageName))
val curTextColor = when {
isPrintVersion -> resources.getColor(R.color.theme_light_text_color)
else -> context!!.config.textColor
else -> requireContext().config.textColor
}
monthLabel.setTextColor(curTextColor)
@ -96,10 +96,10 @@ class YearFragment : Fragment(), YearlyCalendar {
private fun markCurrentMonth(now: DateTime) {
if (now.year == mYear) {
val monthLabel = mView.findViewById<TextView>(resources.getIdentifier("month_${now.monthOfYear}_label", "id", context!!.packageName))
monthLabel.setTextColor(context!!.getAdjustedPrimaryColor())
val monthLabel = mView.findViewById<TextView>(resources.getIdentifier("month_${now.monthOfYear}_label", "id", requireContext().packageName))
monthLabel.setTextColor(requireContext().getAdjustedPrimaryColor())
val monthView = mView.findViewById<SmallMonthView>(resources.getIdentifier("month_${now.monthOfYear}", "id", context!!.packageName))
val monthView = mView.findViewById<SmallMonthView>(resources.getIdentifier("month_${now.monthOfYear}", "id", requireContext().packageName))
monthView.todaysId = now.dayOfMonth
}
}
@ -114,7 +114,7 @@ class YearFragment : Fragment(), YearlyCalendar {
lastHash = hashCode
for (i in 1..12) {
val monthView = mView.findViewById<SmallMonthView>(resources.getIdentifier("month_$i", "id", context!!.packageName))
val monthView = mView.findViewById<SmallMonthView>(resources.getIdentifier("month_$i", "id", requireContext().packageName))
monthView.setEvents(events.get(i))
}
}
@ -124,7 +124,7 @@ class YearFragment : Fragment(), YearlyCalendar {
setupMonths()
toggleSmallMonthPrintModes()
context!!.printBitmap(mView.calendar_holder.getViewBitmap())
requireContext().printBitmap(mView.calendar_holder.getViewBitmap())
isPrintVersion = false
setupMonths()
@ -133,7 +133,7 @@ class YearFragment : Fragment(), YearlyCalendar {
private fun toggleSmallMonthPrintModes() {
for (i in 1..12) {
val monthView = mView.findViewById<SmallMonthView>(resources.getIdentifier("month_$i", "id", context!!.packageName))
val monthView = mView.findViewById<SmallMonthView>(resources.getIdentifier("month_$i", "id", requireContext().packageName))
monthView.togglePrintMode()
}
}

View File

@ -11,7 +11,6 @@ import androidx.appcompat.app.AlertDialog
import androidx.viewpager.widget.ViewPager
import com.simplemobiletools.calendar.pro.R
import com.simplemobiletools.calendar.pro.activities.MainActivity
import com.simplemobiletools.calendar.pro.adapters.MyMonthPagerAdapter
import com.simplemobiletools.calendar.pro.adapters.MyYearPagerAdapter
import com.simplemobiletools.calendar.pro.extensions.config
import com.simplemobiletools.calendar.pro.helpers.Formatter
@ -40,7 +39,7 @@ class YearFragmentsHolder : MyFragmentHolder() {
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
val view = inflater.inflate(R.layout.fragment_years_holder, container, false)
view.background = ColorDrawable(context!!.config.backgroundColor)
view.background = ColorDrawable(requireContext().config.backgroundColor)
viewPager = view.fragment_years_viewpager
viewPager!!.id = (System.currentTimeMillis() % 100000).toInt()
setupFragment()
@ -49,7 +48,7 @@ class YearFragmentsHolder : MyFragmentHolder() {
private fun setupFragment() {
val years = getYears(currentYear)
val yearlyAdapter = MyYearPagerAdapter(activity!!.supportFragmentManager, years)
val yearlyAdapter = MyYearPagerAdapter(requireActivity().supportFragmentManager, years)
defaultYearlyPage = years.size / 2
viewPager?.apply {
@ -91,7 +90,7 @@ class YearFragmentsHolder : MyFragmentHolder() {
}
override fun showGoToDateDialog() {
activity!!.setTheme(context!!.getDialogTheme())
requireActivity().setTheme(requireContext().getDialogTheme())
val view = layoutInflater.inflate(R.layout.date_picker, null)
val datePicker = view.findViewById<DatePicker>(R.id.date_picker)
datePicker.findViewById<View>(Resources.getSystem().getIdentifier("day", "id", "android")).beGone()
@ -100,12 +99,12 @@ class YearFragmentsHolder : MyFragmentHolder() {
val dateTime = DateTime(Formatter.getDateTimeFromCode("${currentYear}0523").toString())
datePicker.init(dateTime.year, dateTime.monthOfYear - 1, 1, null)
AlertDialog.Builder(context!!)
.setNegativeButton(R.string.cancel, null)
.setPositiveButton(R.string.ok) { dialog, which -> datePicked(datePicker) }
.create().apply {
activity?.setupDialogStuff(view, this)
}
AlertDialog.Builder(requireContext())
.setNegativeButton(R.string.cancel, null)
.setPositiveButton(R.string.ok) { dialog, which -> datePicked(datePicker) }
.create().apply {
activity?.setupDialogStuff(view, this)
}
}
private fun datePicked(datePicker: DatePicker) {

View File

@ -36,8 +36,8 @@ const val BIRTHDAY_EVENT = 1
const val ANNIVERSARY_EVENT = 2
const val ITEM_EVENT = 0
const val ITEM_EVENT_SIMPLE = 1
const val ITEM_HEADER = 2
const val ITEM_SECTION_DAY = 1
const val ITEM_SECTION_MONTH = 2
const val DEFAULT_START_TIME_NEXT_FULL_HOUR = -1
const val DEFAULT_START_TIME_CURRENT_TIME = -2

View File

@ -17,6 +17,7 @@ object Formatter {
private const val DAY_PATTERN = "d"
private const val DAY_OF_WEEK_PATTERN = "EEE"
private const val LONGEST_PATTERN = "MMMM d YYYY (EEEE)"
private const val DATE_DAY_PATTERN = "d EEEE"
private const val PATTERN_TIME_12 = "hh:mm a"
private const val PATTERN_TIME_24 = "HH:mm"
@ -29,11 +30,15 @@ object Formatter {
val year = dateTime.toString(YEAR_PATTERN)
val monthIndex = Integer.valueOf(dayCode.substring(4, 6))
var month = getMonthName(context, monthIndex)
if (shortMonth)
if (shortMonth) {
month = month.substring(0, Math.min(month.length, 3))
}
var date = "$month $day"
if (year != DateTime().toString(YEAR_PATTERN))
if (year != DateTime().toString(YEAR_PATTERN)) {
date += " $year"
}
return date
}
@ -47,6 +52,25 @@ object Formatter {
date
}
fun getDateDayTitle(dayCode: String): String {
val dateTime = getDateTimeFromCode(dayCode)
return dateTime.toString(DATE_DAY_PATTERN)
}
fun getLongMonthYear(context: Context, dayCode: String): String {
val dateTime = getDateTimeFromCode(dayCode)
val monthIndex = Integer.valueOf(dayCode.substring(4, 6))
val month = getMonthName(context, monthIndex)
val year = dateTime.toString(YEAR_PATTERN)
var date = month
if (year != DateTime().toString(YEAR_PATTERN)) {
date += " $year"
}
return date
}
fun getLongestDate(ts: Long) = getDateTimeFromTS(ts).toString(LONGEST_PATTERN)
fun getDate(context: Context, dateTime: DateTime, addDayOfWeek: Boolean = true) = getDayTitle(context, getDayCodeFromDateTime(dateTime), addDayOfWeek)
@ -71,7 +95,8 @@ object Formatter {
fun getDateTimeFromCode(dayCode: String) = DateTimeFormat.forPattern(DAYCODE_PATTERN).withZone(DateTimeZone.UTC).parseDateTime(dayCode)
fun getLocalDateTimeFromCode(dayCode: String) = DateTimeFormat.forPattern(DAYCODE_PATTERN).withZone(DateTimeZone.getDefault()).parseLocalDate(dayCode).toDateTimeAtStartOfDay()
fun getLocalDateTimeFromCode(dayCode: String) =
DateTimeFormat.forPattern(DAYCODE_PATTERN).withZone(DateTimeZone.getDefault()).parseLocalDate(dayCode).toDateTimeAtStartOfDay()
fun getTimeFromTS(context: Context, ts: Long) = getTime(context, getDateTimeFromTS(ts))

View File

@ -1,3 +0,0 @@
package com.simplemobiletools.calendar.pro.models
data class ListSection(val title: String, val code: String, val isToday: Boolean, val isPastSection: Boolean) : ListItem()

View File

@ -0,0 +1,3 @@
package com.simplemobiletools.calendar.pro.models
data class ListSectionDay(val title: String, val code: String, val isToday: Boolean, val isPastSection: Boolean) : ListItem()

View File

@ -0,0 +1,3 @@
package com.simplemobiletools.calendar.pro.models
data class ListSectionMonth(val title: String) : ListItem()

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/activated_item_foreground" />
<corners android:radius="@dimen/activity_margin" />
</shape>

View File

@ -1,15 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<size
android:width="@dimen/event_color_bar_width"
android:height="@dimen/event_color_bar_height"/>
<solid android:color="@color/md_grey_white" />
<solid
android:color="@color/white"/>
<corners android:radius="@dimen/small_margin"/>
<corners
android:bottomLeftRadius="@dimen/activity_margin"
android:topLeftRadius="@dimen/activity_margin" />
</shape>

File diff suppressed because one or more lines are too long

View File

@ -1,9 +1,3 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M4,8h4L8,4L4,4v4zM10,20h4v-4h-4v4zM4,20h4v-4L4,16v4zM4,14h4v-4L4,10v4zM10,14h4v-4h-4v4zM16,4v4h4L20,4h-4zM10,8h4L14,4h-4v4zM16,14h4v-4h-4v4zM16,20h4v-4h-4v4z"/>
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
<path android:fillColor="#FFFFFFFF" android:pathData="M4 8h4V4H4v4zm6 12h4v-4h-4v4zm-6 0h4v-4H4v4zm0-6h4v-4H4v4zm6 0h4v-4h-4v4zm6-10v4h4V4h-4zm-6 4h4V4h-4v4zm6 6h4v-4h-4v4zm0 6h4v-4h-4v4z"/>
</vector>

View File

@ -0,0 +1,3 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
<path android:pathData="M4 12a8 8 0 1 1 16 0 8 8 0 1 1-16 0" android:fillColor="#FFFFFFFF"/>
</vector>

View File

@ -1,9 +1,3 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M12,3c-4.97,0 -9,4.03 -9,9s4.03,9 9,9c0.83,0 1.5,-0.67 1.5,-1.5 0,-0.39 -0.15,-0.74 -0.39,-1.01 -0.23,-0.26 -0.38,-0.61 -0.38,-0.99 0,-0.83 0.67,-1.5 1.5,-1.5L16,16c2.76,0 5,-2.24 5,-5 0,-4.42 -4.03,-8 -9,-8zM6.5,12c-0.83,0 -1.5,-0.67 -1.5,-1.5S5.67,9 6.5,9 8,9.67 8,10.5 7.33,12 6.5,12zM9.5,8C8.67,8 8,7.33 8,6.5S8.67,5 9.5,5s1.5,0.67 1.5,1.5S10.33,8 9.5,8zM14.5,8c-0.83,0 -1.5,-0.67 -1.5,-1.5S13.67,5 14.5,5s1.5,0.67 1.5,1.5S15.33,8 14.5,8zM17.5,12c-0.83,0 -1.5,-0.67 -1.5,-1.5S16.67,9 17.5,9s1.5,0.67 1.5,1.5 -0.67,1.5 -1.5,1.5z"/>
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
<path android:fillColor="#FFFFFFFF" android:pathData="M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9c0.83 0 1.5-0.67 1.5-1.5 0-0.39-0.15-0.74-0.39-1.01-0.23-0.26-0.38-0.61-0.38-0.99 0-0.83 0.67-1.5 1.5-1.5H16c2.76 0 5-2.24 5-5 0-4.42-4.03-8-9-8zm-5.5 9C5.67 12 5 11.33 5 10.5S5.67 9 6.5 9 8 9.67 8 10.5 7.33 12 6.5 12zm3-4C8.67 8 8 7.33 8 6.5S8.67 5 9.5 5 11 5.67 11 6.5 10.33 8 9.5 8zm5 0C13.67 8 13 7.33 13 6.5S13.67 5 14.5 5 16 5.67 16 6.5 15.33 8 14.5 8zm3 4c-0.83 0-1.5-0.67-1.5-1.5S16.67 9 17.5 9 19 9.67 19 10.5 18.33 12 17.5 12z"/>
</vector>

View File

@ -1,9 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M19,3h-1L18,1h-2v2L8,3L8,1L6,1v2L5,3c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2L21,5c0,-1.1 -0.9,-2 -2,-2zM19,19L5,19L5,9h14v10zM5,7L5,5h14v2L5,7zM10.56,17.46l5.93,-5.93 -1.06,-1.06 -4.87,4.87 -2.11,-2.11 -1.06,1.06z"/>
</vector>

View File

@ -0,0 +1,3 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
<path android:pathData="M16 10.53c-0.29-0.29-0.77-0.29-1.06 0l-4.35 4.35L9 13.29C8.71 13 8.23 13 7.94 13.29c-0.29 0.29-0.29 0.77 0 1.06l1.94 1.94c0.39 0.39 1.02 0.39 1.41 0l4.7-4.7c0.3-0.29 0.3-0.77 0.01-1.06zM19 3h-1V2c0-0.55-0.45-1-1-1s-1 0.45-1 1v1H8V2c0-0.55-0.45-1-1-1S6 1.45 6 2v1H5C3.89 3 3.01 3.9 3.01 5L3 19c0 1.1 0.89 2 2 2h14c1.1 0 2-0.9 2-2V5c0-1.1-0.9-2-2-2zm-1 16H6c-0.55 0-1-0.45-1-1V8h14v10c0 0.55-0.45 1-1 1z" android:fillColor="#FFFFFFFF"/>
</vector>

View File

@ -0,0 +1,3 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
<path android:pathData="M9.84 16.47l1.91-1.91 1.91 1.91c0.29 0.29 0.77 0.29 1.06 0 0.29-0.29 0.29-0.77 0-1.06l-1.91-1.91 1.91-1.91c0.29-0.29 0.29-0.77 0-1.06-0.29-0.29-0.77-0.29-1.06 0l-1.91 1.91-1.91-1.91c-0.29-0.29-0.77-0.29-1.06 0-0.29 0.29-0.29 0.77 0 1.06l1.91 1.91-1.91 1.91c-0.29 0.29-0.29 0.77 0 1.06 0.29 0.29 0.77 0.29 1.06 0zM19 3h-1V2c0-0.55-0.45-1-1-1s-1 0.45-1 1v1H8V2c0-0.55-0.45-1-1-1S6 1.45 6 2v1H5C3.89 3 3.01 3.9 3.01 5L3 19c0 1.1 0.89 2 2 2h14c1.1 0 2-0.9 2-2V5c0-1.1-0.9-2-2-2zm-1 16H6c-0.55 0-1-0.45-1-1V8h14v10c0 0.55-0.45 1-1 1z" android:fillColor="#FFFFFFFF"/>
</vector>

View File

@ -1,9 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M19,3h-1L18,1h-2v2L8,3L8,1L6,1v2L5,3c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2L21,5c0,-1.1 -0.9,-2 -2,-2zM19,19L5,19L5,9h14v10zM5,7L5,5h14v2L5,7zM8.23,16.41l1.06,1.06 2.44,-2.44 2.44,2.44 1.06,-1.06 -2.44,-2.44 2.44,-2.44 -1.06,-1.06 -2.44,2.44 -2.44,-2.44 -1.06,1.06 2.44,2.44z"/>
</vector>

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,3 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
<path android:pathData="M21 9.5V4.21c0-0.45-0.54-0.67-0.85-0.35l-1.78 1.78c-1.81-1.81-4.39-2.85-7.21-2.6-4.19 0.38-7.64 3.75-8.1 7.94C2.46 16.4 6.69 21 12 21c4.59 0 8.38-3.44 8.93-7.88 0.07-0.6-0.4-1.12-1-1.12-0.5 0-0.92 0.37-0.98 0.86-0.43 3.49-3.44 6.19-7.05 6.14-3.71-0.05-6.84-3.18-6.9-6.9C4.94 8.2 8.11 5 12 5c1.93 0 3.68 0.79 4.95 2.05l-2.09 2.09C14.54 9.46 14.76 10 15.21 10h5.29c0.28 0 0.5-0.22 0.5-0.5z" android:fillColor="#FFFFFFFF"/>
</vector>

View File

@ -1,9 +1,3 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M19,3h-1L18,1h-2v2L8,3L8,1L6,1v2L5,3c-1.11,0 -1.99,0.9 -1.99,2L3,19c0,1.1 0.89,2 2,2h14c1.1,0 2,-0.9 2,-2L21,5c0,-1.1 -0.9,-2 -2,-2zM19,19L5,19L5,8h14v11zM7,10h5v5L7,15z"/>
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
<path android:pathData="M19 3h-1V2c0-0.55-0.45-1-1-1s-1 0.45-1 1v1H8V2c0-0.55-0.45-1-1-1S6 1.45 6 2v1H5C3.89 3 3.01 3.9 3.01 5L3 19c0 1.1 0.89 2 2 2h14c1.1 0 2-0.9 2-2V5c0-1.1-0.9-2-2-2zm-1 16H6c-0.55 0-1-0.45-1-1V8h14v10c0 0.55-0.45 1-1 1zM8 10h3c0.55 0 1 0.45 1 1v3c0 0.55-0.45 1-1 1H8c-0.55 0-1-0.45-1-1v-3c0-0.55 0.45-1 1-1z" android:fillColor="#FFFFFFFF"/>
</vector>

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<selector>
<item
android:drawable="@drawable/activated_item_foreground_rounded"
android:state_selected="true" />
</selector>
</item>
<item>
<ripple android:color="@color/pressed_item_foreground">
<item android:id="@android:id/mask">
<color android:color="@android:color/white" />
</item>
</ripple>
</item>
</layer-list>

View File

@ -81,6 +81,7 @@
android:layout_height="wrap_content"
android:layout_below="@+id/month_3_label"
android:layout_marginStart="@dimen/yearly_month_padding" />
</RelativeLayout>
<RelativeLayout
@ -106,6 +107,7 @@
android:layout_below="@+id/month_4_label"
android:layout_marginStart="@dimen/yearly_month_padding"
app:days="30" />
</RelativeLayout>
</TableRow>
@ -160,6 +162,7 @@
android:layout_below="@+id/month_6_label"
android:layout_marginStart="@dimen/yearly_month_padding"
app:days="30" />
</RelativeLayout>
<RelativeLayout
@ -184,6 +187,7 @@
android:layout_height="match_parent"
android:layout_below="@+id/month_7_label"
android:layout_marginStart="@dimen/yearly_month_padding" />
</RelativeLayout>
<RelativeLayout
@ -209,12 +213,12 @@
android:layout_height="match_parent"
android:layout_below="@+id/month_8_label"
android:layout_marginStart="@dimen/yearly_month_padding" />
</RelativeLayout>
</TableRow>
<TableRow android:layout_weight="1">
<RelativeLayout
android:id="@+id/month_9_holder"
android:layout_width="0dp"
@ -238,6 +242,7 @@
android:layout_below="@+id/month_9_label"
android:layout_marginStart="@dimen/yearly_month_padding"
app:days="30" />
</RelativeLayout>
<RelativeLayout
@ -262,6 +267,7 @@
android:layout_height="match_parent"
android:layout_below="@+id/month_10_label"
android:layout_marginStart="@dimen/yearly_month_padding" />
</RelativeLayout>
<RelativeLayout
@ -288,6 +294,7 @@
android:layout_below="@+id/month_11_label"
android:layout_marginStart="@dimen/yearly_month_padding"
app:days="30" />
</RelativeLayout>
<RelativeLayout

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/day_coordinator"
android:layout_width="match_parent"
@ -10,7 +9,7 @@
android:id="@+id/view_pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/activity_margin"/>
android:layout_marginTop="@dimen/activity_margin" />
<com.simplemobiletools.commons.views.MyFloatingActionButton
android:id="@+id/day_fab"
@ -20,6 +19,6 @@
android:layout_margin="@dimen/activity_margin"
android:src="@drawable/ic_plus_vector"
app:backgroundTint="@color/color_primary"
app:rippleColor="@color/pressed_item_foreground"/>
app:rippleColor="@color/pressed_item_foreground" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/event_scrollview"
android:layout_width="match_parent"
@ -86,33 +85,43 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_below="@+id/event_description_divider"
android:layout_alignTop="@+id/event_all_day"
android:layout_alignBottom="@+id/event_all_day"
android:layout_alignTop="@+id/event_all_day_holder"
android:layout_alignBottom="@+id/event_all_day_holder"
android:layout_marginStart="@dimen/normal_margin"
android:padding="@dimen/medium_margin"
android:src="@drawable/ic_clock_vector" />
<com.simplemobiletools.commons.views.MySwitchCompat
android:id="@+id/event_all_day"
<RelativeLayout
android:id="@+id/event_all_day_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/event_description_divider"
android:layout_alignParentEnd="true"
android:layout_marginStart="@dimen/small_margin"
android:layout_marginEnd="@dimen/normal_margin"
android:layout_toEndOf="@+id/event_time_image"
android:background="?attr/selectableItemBackground"
android:paddingTop="@dimen/normal_margin"
android:paddingBottom="@dimen/normal_margin"
android:text="@string/all_day"
android:textSize="@dimen/day_text_size"
app:switchPadding="@dimen/small_margin" />
android:paddingEnd="@dimen/normal_margin"
android:paddingBottom="@dimen/normal_margin">
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
android:id="@+id/event_all_day"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:clickable="false"
android:layoutDirection="rtl"
android:text="@string/all_day"
android:textSize="@dimen/day_text_size" />
</RelativeLayout>
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/event_start_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/event_time_image"
android:layout_alignStart="@+id/event_all_day"
android:layout_alignStart="@+id/event_all_day_holder"
android:background="?attr/selectableItemBackground"
android:paddingTop="@dimen/activity_margin"
android:paddingEnd="@dimen/activity_margin"
@ -136,7 +145,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/event_start_date"
android:layout_alignStart="@+id/event_all_day"
android:layout_alignStart="@+id/event_all_day_holder"
android:background="?attr/selectableItemBackground"
android:paddingTop="@dimen/activity_margin"
android:paddingEnd="@dimen/activity_margin"
@ -228,7 +237,7 @@
android:layout_alignBottom="@+id/event_reminder_1"
android:layout_alignParentEnd="true"
android:layout_marginStart="@dimen/small_margin"
android:background="?attr/selectableItemBackground"
android:background="?attr/selectableItemBackgroundBorderless"
android:padding="@dimen/activity_margin"
android:src="@drawable/ic_bell_vector" />
@ -259,7 +268,7 @@
android:layout_alignBottom="@+id/event_reminder_2"
android:layout_alignParentEnd="true"
android:layout_marginStart="@dimen/small_margin"
android:background="?attr/selectableItemBackground"
android:background="?attr/selectableItemBackgroundBorderless"
android:padding="@dimen/activity_margin"
android:src="@drawable/ic_bell_vector" />
@ -290,7 +299,7 @@
android:layout_alignBottom="@+id/event_reminder_3"
android:layout_alignParentEnd="true"
android:layout_marginStart="@dimen/small_margin"
android:background="?attr/selectableItemBackground"
android:background="?attr/selectableItemBackgroundBorderless"
android:padding="@dimen/activity_margin"
android:src="@drawable/ic_bell_vector" />
@ -438,22 +447,22 @@
android:layout_alignBottom="@+id/event_availability"
android:layout_marginStart="@dimen/normal_margin"
android:padding="@dimen/medium_margin"
android:src="@drawable/ic_event_occupied" />
android:src="@drawable/ic_event_busy_vector" />
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/event_availability"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/event_attendees_divider"
android:layout_toEndOf="@+id/event_availability_image"
android:layout_marginStart="@dimen/small_margin"
android:layout_marginTop="@dimen/medium_margin"
android:paddingTop="@dimen/normal_margin"
android:paddingBottom="@dimen/normal_margin"
android:paddingEnd="@dimen/activity_margin"
android:layout_toEndOf="@+id/event_availability_image"
android:background="?attr/selectableItemBackground"
android:textSize="@dimen/day_text_size"
android:text="@string/status_busy" />
android:paddingTop="@dimen/normal_margin"
android:paddingEnd="@dimen/activity_margin"
android:paddingBottom="@dimen/normal_margin"
android:text="@string/status_busy"
android:textSize="@dimen/day_text_size" />
<ImageView
android:id="@+id/event_availability_divider"

View File

@ -19,9 +19,7 @@
<FrameLayout
android:id="@+id/fragments_holder"
android:layout_width="match_parent"
android:layout_height="match_parent">
</FrameLayout>
android:layout_height="match_parent" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

View File

@ -1,9 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<com.simplemobiletools.commons.views.MyRecyclerView
xmlns:android="http://schemas.android.com/apk/res/android"
<com.simplemobiletools.commons.views.MyRecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/manage_event_types_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
app:layoutManager="com.simplemobiletools.commons.views.MyLinearLayoutManager"/>
app:layoutManager="com.simplemobiletools.commons.views.MyLinearLayoutManager" />

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
android:layout_height="wrap_content" />

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/calendar_item_calendar_holder"
android:layout_width="match_parent"
@ -13,10 +12,10 @@
android:layout_height="wrap_content"
android:background="@null"
android:clickable="false"
android:paddingBottom="@dimen/activity_margin"
android:paddingStart="@dimen/big_margin"
android:paddingEnd="@dimen/activity_margin"
android:paddingTop="@dimen/activity_margin"
tools:text="Calendar name"/>
android:paddingEnd="@dimen/activity_margin"
android:paddingBottom="@dimen/activity_margin"
tools:text="Calendar name" />
</RelativeLayout>

View File

@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<DatePicker
xmlns:android="http://schemas.android.com/apk/res/android"
<DatePicker xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/date_picker"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:calendarViewShown="false"
android:datePickerMode="spinner"/>
android:datePickerMode="spinner" />

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/day_monthly_event_id"
android:layout_width="match_parent"
@ -14,4 +13,4 @@
android:paddingEnd="@dimen/tiny_margin"
android:textSize="@dimen/day_monthly_text_size"
tools:targetApi="m"
tools:text="1"/>
tools:text="1" />

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/day_monthly_number_id"
android:layout_width="match_parent"
@ -13,4 +12,4 @@
android:paddingStart="@dimen/tiny_margin"
android:paddingEnd="@dimen/tiny_margin"
android:textSize="@dimen/normal_text_size"
tools:text="1"/>
tools:text="1" />

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/dialog_custom_repeat_interval_scrollview"
android:layout_width="match_parent"
android:layout_height="wrap_content">
@ -11,8 +10,8 @@
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingStart="@dimen/activity_margin"
android:paddingEnd="@dimen/activity_margin"
android:paddingTop="@dimen/activity_margin">
android:paddingTop="@dimen/activity_margin"
android:paddingEnd="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MyEditText
android:id="@+id/dialog_custom_repeat_interval_value"
@ -23,7 +22,7 @@
android:inputType="number"
android:maxLength="4"
android:textCursorDrawable="@null"
android:textSize="@dimen/normal_text_size"/>
android:textSize="@dimen/normal_text_size" />
<RadioGroup
android:id="@+id/dialog_radio_view"
@ -35,33 +34,33 @@
android:id="@+id/dialog_radio_days"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/normal_margin"
android:paddingTop="@dimen/normal_margin"
android:text="@string/days_raw"/>
android:paddingBottom="@dimen/normal_margin"
android:text="@string/days_raw" />
<com.simplemobiletools.commons.views.MyCompatRadioButton
android:id="@+id/dialog_radio_weeks"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/normal_margin"
android:paddingTop="@dimen/normal_margin"
android:text="@string/weeks_raw"/>
android:paddingBottom="@dimen/normal_margin"
android:text="@string/weeks_raw" />
<com.simplemobiletools.commons.views.MyCompatRadioButton
android:id="@+id/dialog_radio_months"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/normal_margin"
android:paddingTop="@dimen/normal_margin"
android:text="@string/months_raw"/>
android:paddingBottom="@dimen/normal_margin"
android:text="@string/months_raw" />
<com.simplemobiletools.commons.views.MyCompatRadioButton
android:id="@+id/dialog_radio_years"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/normal_margin"
android:paddingTop="@dimen/normal_margin"
android:text="@string/years_raw"/>
android:paddingBottom="@dimen/normal_margin"
android:text="@string/years_raw" />
</RadioGroup>
</LinearLayout>

View File

@ -1,20 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/delete_event_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingStart="@dimen/big_margin"
android:paddingEnd="@dimen/big_margin"
android:paddingTop="@dimen/big_margin">
android:paddingTop="@dimen/big_margin"
android:paddingEnd="@dimen/big_margin">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/delete_event_description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/proceed_with_deletion"
android:textSize="@dimen/bigger_text_size"/>
android:textSize="@dimen/bigger_text_size" />
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/delete_event_repeat_description"
@ -23,7 +22,7 @@
android:layout_marginTop="@dimen/activity_margin"
android:paddingBottom="@dimen/normal_margin"
android:text="@string/event_is_repeatable"
android:textSize="@dimen/normal_text_size"/>
android:textSize="@dimen/normal_text_size" />
<RadioGroup
android:id="@+id/delete_event_radio_view"
@ -35,24 +34,24 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:checked="true"
android:paddingBottom="@dimen/normal_margin"
android:paddingTop="@dimen/normal_margin"
android:text="@string/delete_one_only"/>
android:paddingBottom="@dimen/normal_margin"
android:text="@string/delete_one_only" />
<com.simplemobiletools.commons.views.MyCompatRadioButton
android:id="@+id/delete_event_future"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/normal_margin"
android:paddingTop="@dimen/normal_margin"
android:text="@string/delete_future_occurrences"/>
android:paddingBottom="@dimen/normal_margin"
android:text="@string/delete_future_occurrences" />
<com.simplemobiletools.commons.views.MyCompatRadioButton
android:id="@+id/delete_event_all"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/normal_margin"
android:paddingTop="@dimen/normal_margin"
android:text="@string/delete_all_occurrences"/>
android:paddingBottom="@dimen/normal_margin"
android:text="@string/delete_all_occurrences" />
</RadioGroup>
</LinearLayout>

View File

@ -1,20 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/edit_repeating_event_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingStart="@dimen/big_margin"
android:paddingEnd="@dimen/big_margin"
android:paddingTop="@dimen/big_margin">
android:paddingTop="@dimen/big_margin"
android:paddingEnd="@dimen/big_margin">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/edit_repeating_event_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/activity_margin"
android:text="@string/event_is_repeatable"/>
android:text="@string/event_is_repeatable" />
<RadioGroup
android:id="@+id/edit_repeating_event_radiogroup"
@ -26,9 +25,9 @@
android:id="@+id/edit_repeating_event_one_only"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/activity_margin"
android:paddingTop="@dimen/activity_margin"
android:text="@string/update_one_only"/>
android:paddingBottom="@dimen/activity_margin"
android:text="@string/update_one_only" />
<com.simplemobiletools.commons.views.MyCompatRadioButton
android:id="@+id/edit_repeating_event_this_and_future_occurences"
@ -42,9 +41,9 @@
android:id="@+id/edit_repeating_event_all_occurrences"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/activity_margin"
android:paddingTop="@dimen/activity_margin"
android:text="@string/update_all_occurrences"/>
android:paddingBottom="@dimen/activity_margin"
android:text="@string/update_all_occurrences" />
</RadioGroup>
</LinearLayout>

View File

@ -1,45 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/event_type_dialog_holder"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingStart="@dimen/activity_margin"
android:paddingEnd="@dimen/activity_margin"
android:paddingTop="@dimen/activity_margin">
android:paddingTop="@dimen/activity_margin"
android:paddingEnd="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/type_title_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/title"/>
android:layout_marginStart="@dimen/small_margin"
android:text="@string/title" />
<com.simplemobiletools.commons.views.MyEditText
android:id="@+id/type_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/activity_margin"
android:layout_marginLeft="@dimen/small_margin"
android:layout_marginStart="@dimen/small_margin"
android:inputType="textCapSentences"
android:maxLength="80"
android:singleLine="true"
android:textCursorDrawable="@null"
android:textSize="@dimen/normal_text_size"/>
android:textSize="@dimen/normal_text_size" />
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/type_color_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/color"/>
android:layout_marginStart="@dimen/small_margin"
android:text="@string/color" />
<ImageView
android:id="@+id/type_color"
android:layout_width="@dimen/color_sample_size"
android:layout_height="@dimen/color_sample_size"
android:layout_marginLeft="@dimen/medium_margin"
android:layout_marginStart="@dimen/medium_margin"
android:layout_marginTop="@dimen/medium_margin"/>
android:layout_marginStart="@dimen/small_margin"
android:layout_marginTop="@dimen/medium_margin" />
</LinearLayout>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/export_events_scrollview"
android:layout_width="match_parent"
android:layout_height="wrap_content">
@ -11,56 +11,73 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingStart="@dimen/activity_margin"
android:paddingTop="@dimen/activity_margin"
android:paddingEnd="@dimen/activity_margin">
android:paddingTop="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/export_events_folder_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/medium_margin"
android:paddingStart="@dimen/normal_margin"
android:text="@string/folder"
android:textSize="@dimen/smaller_text_size"/>
android:textSize="@dimen/smaller_text_size" />
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/export_events_folder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/activity_margin"
android:layout_marginEnd="@dimen/activity_margin"
android:layout_marginBottom="@dimen/activity_margin"
android:paddingTop="@dimen/small_margin"
android:paddingEnd="@dimen/small_margin"
android:paddingBottom="@dimen/small_margin"/>
android:padding="@dimen/small_margin"
tools:text="Internal/" />
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/export_events_filename_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/small_margin"
android:paddingStart="@dimen/activity_margin"
android:text="@string/filename_without_ics"
android:textSize="@dimen/smaller_text_size"/>
android:textSize="@dimen/smaller_text_size" />
<com.simplemobiletools.commons.views.MyEditText
android:id="@+id/export_events_filename"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/activity_margin"
android:layout_marginBottom="@dimen/activity_margin"
android:layout_marginEnd="@dimen/big_margin"
android:paddingTop="@dimen/normal_margin"
android:paddingEnd="@dimen/small_margin"
android:textSize="@dimen/normal_text_size"/>
android:paddingEnd="@dimen/activity_margin"
android:textSize="@dimen/normal_text_size" />
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
android:id="@+id/export_events_checkbox"
<RelativeLayout
android:id="@+id/export_past_events_checkbox_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/small_margin"
android:paddingBottom="@dimen/small_margin"
android:text="@string/export_past_events_too"/>
android:background="?attr/selectableItemBackground"
android:paddingStart="@dimen/normal_margin"
android:paddingTop="@dimen/normal_margin"
android:paddingEnd="@dimen/activity_margin"
android:paddingBottom="@dimen/normal_margin">
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
android:id="@+id/export_past_events_checkbox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:clickable="false"
android:layoutDirection="rtl"
android:padding="@dimen/medium_margin"
android:text="@string/export_past_events_too" />
</RelativeLayout>
<LinearLayout
android:id="@+id/export_events_pick_types"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/activity_margin"
android:orientation="vertical"
android:visibility="gone">
@ -71,14 +88,15 @@
android:layout_marginTop="@dimen/medium_margin"
android:layout_marginBottom="@dimen/medium_margin"
android:background="@color/divider_grey"
android:importantForAccessibility="no"/>
android:importantForAccessibility="no" />
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/export_events_pick_types_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/small_margin"
android:text="@string/include_event_types"
android:textSize="@dimen/smaller_text_size"/>
android:textSize="@dimen/smaller_text_size" />
<com.simplemobiletools.commons.views.MyRecyclerView
android:id="@+id/export_events_types_list"
@ -87,7 +105,7 @@
android:clipToPadding="false"
android:overScrollMode="never"
android:paddingTop="@dimen/medium_margin"
app:layoutManager="com.simplemobiletools.commons.views.MyLinearLayoutManager"/>
app:layoutManager="com.simplemobiletools.commons.views.MyLinearLayoutManager" />
</LinearLayout>
</LinearLayout>

View File

@ -5,14 +5,14 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingTop="@dimen/activity_margin"
android:paddingEnd="@dimen/activity_margin">
android:paddingTop="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/import_events_event_type_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/activity_margin"
android:layout_marginStart="@dimen/medium_margin"
android:paddingStart="@dimen/normal_margin"
android:text="@string/default_event_type"
android:textSize="@dimen/smaller_text_size" />
@ -20,9 +20,11 @@
android:id="@+id/import_event_type_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/activity_margin"
android:background="?attr/selectableItemBackground"
android:padding="@dimen/small_margin">
android:paddingStart="@dimen/normal_margin"
android:paddingTop="@dimen/normal_margin"
android:paddingEnd="@dimen/activity_margin"
android:paddingBottom="@dimen/normal_margin">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/import_event_type_title"
@ -30,7 +32,7 @@
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toStartOf="@+id/import_event_type_color"
android:paddingStart="@dimen/small_margin"
android:paddingStart="@dimen/medium_margin"
android:paddingEnd="@dimen/medium_margin"
tools:text="@string/regular_event" />
@ -39,18 +41,29 @@
android:layout_width="@dimen/color_sample_size"
android:layout_height="@dimen/color_sample_size"
android:layout_alignParentEnd="true"
android:layout_marginEnd="@dimen/medium_margin"
android:clickable="false" />
</RelativeLayout>
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
android:id="@+id/import_events_checkbox"
<RelativeLayout
android:id="@+id/import_events_checkbox_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/normal_margin"
android:paddingTop="@dimen/activity_margin"
android:paddingBottom="@dimen/activity_margin"
android:text="@string/ignore_event_types" />
android:background="?attr/selectableItemBackground"
android:paddingStart="@dimen/normal_margin"
android:paddingTop="@dimen/normal_margin"
android:paddingEnd="@dimen/activity_margin"
android:paddingBottom="@dimen/normal_margin">
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
android:id="@+id/import_events_checkbox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:clickable="false"
android:layoutDirection="rtl"
android:padding="@dimen/medium_margin"
android:text="@string/ignore_event_types" />
</RelativeLayout>
</LinearLayout>

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/dialog_repeat_type_picker_holder"
android:layout_width="match_parent"
@ -16,41 +15,39 @@
android:id="@+id/repeat_type_till_date"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/repeat_till_date"/>
android:text="@string/repeat_till_date" />
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/repeat_type_date"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/repeat_type_margin_start"
android:layout_marginStart="@dimen/repeat_type_margin_start"
android:paddingBottom="@dimen/normal_margin"
android:paddingTop="@dimen/medium_margin"
tools:text="January 1 1970"/>
android:paddingBottom="@dimen/normal_margin"
tools:text="January 1 1970" />
<com.simplemobiletools.commons.views.MyCompatRadioButton
android:id="@+id/repeat_type_x_times"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/small_margin"
android:text="@string/stop_repeating_after_x"/>
android:text="@string/stop_repeating_after_x" />
<com.simplemobiletools.commons.views.MyEditText
android:id="@+id/repeat_type_count"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/repeat_type_margin_start"
android:layout_marginStart="@dimen/repeat_type_margin_start"
android:inputType="number"
android:maxLength="5"
android:textSize="@dimen/normal_text_size"/>
android:textSize="@dimen/normal_text_size" />
<com.simplemobiletools.commons.views.MyCompatRadioButton
android:id="@+id/repeat_type_forever"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/medium_margin"
android:text="@string/repeat_forever"/>
android:text="@string/repeat_forever" />
</RadioGroup>
</ScrollView>

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/dialog_select_event_type_color_scrollview"
android:layout_width="match_parent"
android:layout_height="wrap_content">
@ -18,10 +17,10 @@
android:paddingStart="@dimen/big_margin"
android:paddingTop="@dimen/activity_margin"
android:paddingEnd="@dimen/activity_margin"
android:visibility="gone"
android:paddingBottom="@dimen/activity_margin"
android:text="@string/select_a_different_caldav_color"
android:textSize="@dimen/normal_text_size"/>
android:textSize="@dimen/normal_text_size"
android:visibility="gone" />
<ImageView
android:id="@+id/dialog_select_event_type_other_divider"
@ -29,8 +28,8 @@
android:layout_height="1px"
android:layout_below="@+id/dialog_select_event_type_other_value"
android:background="@color/divider_grey"
android:visibility="gone"
android:importantForAccessibility="no"/>
android:importantForAccessibility="no"
android:visibility="gone" />
<RadioGroup
android:id="@+id/dialog_select_event_type_color_radio"
@ -40,6 +39,7 @@
android:paddingStart="@dimen/activity_margin"
android:paddingTop="@dimen/normal_margin"
android:paddingEnd="@dimen/activity_margin"
android:paddingBottom="@dimen/normal_margin"/>
android:paddingBottom="@dimen/normal_margin" />
</RelativeLayout>
</ScrollView>

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/dialog_radio_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content">
@ -9,9 +8,9 @@
android:id="@+id/dialog_radio_group"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/normal_margin"
android:paddingStart="@dimen/activity_margin"
android:paddingTop="@dimen/normal_margin"
android:paddingEnd="@dimen/activity_margin"
android:paddingTop="@dimen/normal_margin"/>
android:paddingBottom="@dimen/normal_margin" />
</ScrollView>

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/set_reminders_holder_dialog_holder"
android:layout_width="match_parent"
android:layout_height="match_parent"
@ -17,7 +16,7 @@
android:layout_marginStart="@dimen/normal_margin"
android:alpha="0.8"
android:padding="@dimen/medium_margin"
android:src="@drawable/ic_bell_vector"/>
android:src="@drawable/ic_bell_vector" />
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/set_reminders_1"
@ -28,7 +27,7 @@
android:background="?attr/selectableItemBackground"
android:paddingTop="@dimen/activity_margin"
android:paddingBottom="@dimen/activity_margin"
android:textSize="@dimen/day_text_size"/>
android:textSize="@dimen/day_text_size" />
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/set_reminders_2"
@ -41,7 +40,7 @@
android:paddingBottom="@dimen/activity_margin"
android:text="@string/add_another_reminder"
android:textSize="@dimen/day_text_size"
android:visibility="gone"/>
android:visibility="gone" />
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/set_reminders_3"
@ -54,7 +53,7 @@
android:paddingBottom="@dimen/activity_margin"
android:text="@string/add_another_reminder"
android:textSize="@dimen/day_text_size"
android:visibility="gone"/>
android:visibility="gone" />
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
android:id="@+id/add_event_automatically_checkbox"

View File

@ -1,10 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/dialog_vertical_linear_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingStart="@dimen/activity_margin"
android:paddingEnd="@dimen/activity_margin"
android:paddingTop="@dimen/activity_margin"/>
android:paddingTop="@dimen/activity_margin"
android:paddingEnd="@dimen/activity_margin" />

View File

@ -1,75 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/event_item_frame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:foreground="@drawable/selector"
android:paddingStart="@dimen/activity_margin">
<RelativeLayout
android:id="@+id/event_item_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/normal_margin"
android:paddingTop="@dimen/normal_margin">
<ImageView
android:id="@+id/event_item_color_bar"
android:layout_width="@dimen/event_color_bar_width"
android:layout_height="match_parent"
android:layout_alignBottom="@+id/event_item_description"
android:layout_alignTop="@+id/event_item_title"
android:layout_marginEnd="@dimen/small_margin"
android:background="@drawable/event_list_color_bar"
android:paddingBottom="@dimen/tiny_margin"
android:paddingTop="@dimen/tiny_margin"/>
<TextView
android:id="@+id/event_item_start"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toEndOf="@+id/event_item_color_bar"
android:textSize="@dimen/day_text_size"
tools:text="13:00"/>
<TextView
android:id="@+id/event_item_end"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/event_item_start"
android:layout_toEndOf="@+id/event_item_color_bar"
android:text="15:00"
android:textSize="@dimen/day_text_size"/>
<TextView
android:id="@+id/event_item_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/activity_margin"
android:layout_toEndOf="@+id/event_item_start"
android:ellipsize="end"
android:maxLines="1"
android:paddingEnd="@dimen/activity_margin"
android:textSize="@dimen/day_text_size"
tools:text="Event title"/>
<TextView
android:id="@+id/event_item_description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/event_item_title"
android:layout_marginStart="@dimen/activity_margin"
android:layout_toEndOf="@+id/event_item_end"
android:ellipsize="end"
android:maxLines="1"
android:paddingEnd="@dimen/activity_margin"
android:textSize="@dimen/day_text_size"
tools:text="Event description"/>
</RelativeLayout>
</FrameLayout>

View File

@ -1,54 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/event_item_frame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:foreground="@drawable/selector"
android:paddingStart="@dimen/activity_margin">
<RelativeLayout
android:id="@+id/event_item_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/normal_margin"
android:paddingEnd="@dimen/activity_margin"
android:paddingTop="@dimen/normal_margin">
<ImageView
android:id="@+id/event_item_color_bar"
android:layout_width="@dimen/event_color_bar_width"
android:layout_height="match_parent"
android:layout_alignBottom="@+id/event_item_start"
android:layout_alignTop="@+id/event_item_start"
android:layout_marginEnd="@dimen/small_margin"
android:background="@drawable/event_list_color_bar"
android:paddingBottom="@dimen/tiny_margin"
android:paddingTop="@dimen/tiny_margin"/>
<TextView
android:id="@+id/event_item_start"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toEndOf="@+id/event_item_color_bar"
android:textSize="@dimen/day_text_size"
tools:text="13:00"/>
<TextView
android:id="@+id/event_item_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/activity_margin"
android:layout_toEndOf="@+id/event_item_start"
android:ellipsize="end"
android:maxLines="1"
android:paddingEnd="@dimen/activity_margin"
android:textSize="@dimen/day_text_size"
tools:text="Event title"/>
</RelativeLayout>
</FrameLayout>

View File

@ -1,78 +1,85 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/event_item_frame"
android:id="@+id/event_item_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:foreground="@drawable/selector"
android:paddingStart="@dimen/activity_margin">
android:layout_marginStart="@dimen/activity_margin"
android:layout_marginEnd="@dimen/activity_margin"
android:layout_marginBottom="@dimen/medium_margin"
android:background="@drawable/section_holder_stroke"
android:foreground="@drawable/selector_rounded">
<RelativeLayout
android:id="@+id/event_item_holder"
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/medium_margin"
android:paddingEnd="@dimen/activity_margin"
android:paddingTop="@dimen/medium_margin">
android:background="@drawable/ripple_all_corners"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/event_item_color_bar"
android:layout_width="@dimen/event_color_bar_width"
android:layout_height="match_parent"
android:layout_alignBottom="@+id/event_item_end"
android:layout_alignTop="@+id/event_item_start"
android:layout_height="0dp"
android:layout_marginEnd="@dimen/small_margin"
android:background="@drawable/event_list_color_bar"
android:paddingBottom="@dimen/tiny_margin"
android:paddingTop="@dimen/tiny_margin"/>
<TextView
android:id="@+id/event_item_start"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toEndOf="@+id/event_item_color_bar"
android:textSize="@dimen/day_text_size"
tools:text="13:00"/>
<TextView
android:id="@+id/event_item_end"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/event_item_start"
android:layout_toEndOf="@+id/event_item_color_bar"
android:includeFontPadding="false"
android:text="15:00"
android:textSize="@dimen/day_text_size"/>
android:contentDescription="@null"
app:layout_constraintBottom_toBottomOf="@+id/event_item_description"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/event_item_title" />
<TextView
android:id="@+id/event_item_title"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/activity_margin"
android:layout_toEndOf="@+id/event_item_start"
android:layout_marginStart="@dimen/medium_margin"
android:ellipsize="end"
android:includeFontPadding="false"
android:maxLines="1"
android:paddingTop="@dimen/small_margin"
android:paddingEnd="@dimen/activity_margin"
android:paddingBottom="@dimen/tiny_margin"
android:textSize="@dimen/day_text_size"
tools:text="Event title"/>
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/event_item_color_bar"
app:layout_constraintTop_toTopOf="parent"
tools:text="Event title" />
<TextView
android:id="@+id/event_item_description"
android:layout_width="wrap_content"
<android.widget.TextView
android:id="@+id/event_item_time"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_below="@+id/event_item_title"
android:layout_marginStart="@dimen/activity_margin"
android:layout_toEndOf="@+id/event_item_end"
android:layout_alignStart="@+id/event_item_title"
android:alpha="0.8"
android:includeFontPadding="false"
android:paddingBottom="@dimen/small_margin"
android:textFontWeight="300"
android:textSize="@dimen/normal_text_size"
app:layout_constraintStart_toStartOf="@+id/event_item_title"
app:layout_constraintTop_toBottomOf="@+id/event_item_title"
tools:text="13:00" />
<android.widget.TextView
android:id="@+id/event_item_description"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_below="@+id/event_item_title"
android:alpha="0.8"
android:ellipsize="end"
android:includeFontPadding="false"
android:maxLines="1"
android:paddingEnd="@dimen/activity_margin"
android:textSize="@dimen/day_text_size"
tools:text="Event description"/>
android:paddingBottom="@dimen/small_margin"
android:textFontWeight="300"
android:textSize="@dimen/normal_text_size"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@+id/event_item_time"
app:layout_constraintTop_toBottomOf="@+id/event_item_time"
tools:text="Event description" />
</RelativeLayout>
</FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,54 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/event_item_frame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:foreground="@drawable/selector"
android:paddingStart="@dimen/activity_margin">
<RelativeLayout
android:id="@+id/event_item_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/normal_margin"
android:paddingEnd="@dimen/activity_margin"
android:paddingTop="@dimen/normal_margin">
<ImageView
android:id="@+id/event_item_color_bar"
android:layout_width="@dimen/event_color_bar_width"
android:layout_height="match_parent"
android:layout_alignBottom="@+id/event_item_start"
android:layout_alignTop="@+id/event_item_start"
android:layout_marginEnd="@dimen/small_margin"
android:background="@drawable/event_list_color_bar"
android:paddingBottom="@dimen/tiny_margin"
android:paddingTop="@dimen/tiny_margin"/>
<TextView
android:id="@+id/event_item_start"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toEndOf="@+id/event_item_color_bar"
android:textSize="@dimen/day_text_size"
tools:text="13:00"/>
<TextView
android:id="@+id/event_item_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/activity_margin"
android:layout_toEndOf="@+id/event_item_start"
android:ellipsize="end"
android:maxLines="1"
android:paddingEnd="@dimen/activity_margin"
android:textSize="@dimen/day_text_size"
tools:text="Event title"/>
</RelativeLayout>
</FrameLayout>

View File

@ -1,65 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/event_item_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/medium_margin"
android:layout_marginTop="@dimen/small_margin"
android:layout_marginEnd="@dimen/medium_margin"
android:layout_marginBottom="@dimen/medium_margin"
android:background="@drawable/section_holder_stroke"
android:paddingTop="@dimen/medium_margin"
android:paddingBottom="@dimen/medium_margin">
<ImageView
android:id="@+id/event_item_color_bar"
android:layout_width="@dimen/event_color_bar_width"
android:layout_width="4dp"
android:layout_height="match_parent"
android:layout_alignTop="@+id/event_item_start"
android:layout_alignBottom="@+id/event_item_end"
android:layout_alignTop="@+id/event_item_title"
android:layout_alignBottom="@+id/event_item_time"
android:layout_marginEnd="@dimen/small_margin"
android:background="@drawable/event_list_color_bar"
android:paddingTop="@dimen/tiny_margin"
android:paddingBottom="@dimen/tiny_margin"/>
<TextView
android:id="@+id/event_item_start"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toEndOf="@+id/event_item_color_bar"
android:text="13:00"
android:textSize="@dimen/day_text_size"/>
<TextView
android:id="@+id/event_item_end"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/event_item_start"
android:layout_toEndOf="@+id/event_item_color_bar"
android:includeFontPadding="false"
android:text="15:00"
android:textSize="@dimen/day_text_size"/>
android:scaleType="fitXY" />
<TextView
android:id="@+id/event_item_title"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/normal_margin"
android:layout_toEndOf="@+id/event_item_start"
android:ellipsize="end"
android:maxLines="1"
android:paddingEnd="@dimen/small_margin"
android:textSize="@dimen/day_text_size"
tools:text="Event title"/>
tools:text="Event title" />
<TextView
android:id="@+id/event_item_description"
android:layout_width="wrap_content"
android:id="@+id/event_item_time"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/event_item_title"
android:layout_marginStart="@dimen/normal_margin"
android:layout_toEndOf="@+id/event_item_end"
android:ellipsize="end"
android:includeFontPadding="false"
android:maxLines="1"
android:paddingEnd="@dimen/small_margin"
android:textSize="@dimen/day_text_size"
tools:text="Event description"/>
android:layout_alignStart="@+id/event_item_title"
android:alpha="0.8"
android:lineSpacingExtra="2dp"
android:textSize="@dimen/normal_text_size"
tools:text="13:00" />
</RelativeLayout>

View File

@ -1,41 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/event_item_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/medium_margin">
<ImageView
android:id="@+id/event_item_color_bar"
android:layout_width="@dimen/event_color_bar_width"
android:layout_height="match_parent"
android:layout_alignBottom="@+id/event_item_start"
android:layout_alignTop="@+id/event_item_start"
android:layout_marginEnd="@dimen/small_margin"
android:background="@drawable/event_list_color_bar"
android:paddingBottom="@dimen/tiny_margin"
android:paddingTop="@dimen/tiny_margin"/>
<TextView
android:id="@+id/event_item_start"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toEndOf="@+id/event_item_color_bar"
android:textSize="@dimen/day_text_size"
tools:text="13:00"/>
<TextView
android:id="@+id/event_item_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/normal_margin"
android:layout_toEndOf="@+id/event_item_start"
android:ellipsize="end"
android:maxLines="1"
android:paddingEnd="@dimen/small_margin"
android:textSize="@dimen/day_text_size"
tools:text="Event title"/>
</RelativeLayout>

View File

@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<com.simplemobiletools.commons.views.MyTextView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/event_section_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="false"
android:drawableTop="@drawable/divider_width"
android:drawablePadding="@dimen/medium_margin"
android:focusable="false"
android:paddingStart="@dimen/activity_margin"
android:paddingTop="@dimen/medium_margin"
android:textAllCaps="true"
android:textSize="@dimen/normal_text_size"
android:textStyle="bold" />

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/event_section_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/activity_margin"
android:clickable="false"
android:focusable="false"
android:paddingStart="@dimen/activity_margin"
android:paddingBottom="@dimen/small_margin"
android:textSize="@dimen/normal_text_size" />

View File

@ -1,12 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/event_section_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawablePadding="1dp"
android:drawableTop="@drawable/divider_width"
android:paddingStart="@dimen/bigger_margin"
android:paddingBottom="@dimen/small_margin"
android:paddingTop="@dimen/small_margin"
android:textSize="@dimen/normal_text_size"
android:textStyle="bold"/>
android:textStyle="bold" />

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<android.widget.TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/event_section_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="false"
android:focusable="false"
android:paddingStart="@dimen/activity_margin"
android:paddingTop="@dimen/normal_margin"
android:paddingBottom="@dimen/small_margin"
android:textAllCaps="true"
android:textFontWeight="300"
android:textSize="22sp" />

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/event_section_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="@dimen/medium_margin"
android:paddingBottom="@dimen/small_margin"
android:textAllCaps="true"
android:textFontWeight="300"
android:textSize="20sp" />

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/filter_event_type_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -13,18 +12,17 @@
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/medium_margin"
android:layout_toStartOf="@+id/filter_event_type_color"
android:background="@null"
android:clickable="false"
android:paddingStart="@dimen/small_margin"/>
android:paddingStart="@dimen/small_margin" />
<ImageView
android:id="@+id/filter_event_type_color"
android:layout_width="@dimen/color_sample_size"
android:layout_height="@dimen/color_sample_size"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginEnd="@dimen/medium_margin"
android:layout_marginRight="@dimen/medium_margin"
android:clickable="false"/>
android:clickable="false" />
</RelativeLayout>

View File

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:paddingBottom="@dimen/small_margin"
android:paddingTop="@dimen/small_margin">
android:paddingTop="@dimen/small_margin"
android:paddingBottom="@dimen/small_margin">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/week_num"
@ -14,7 +14,8 @@
android:layout_height="match_parent"
android:layout_weight="1"
android:text="#"
android:visibility="gone"/>
android:visibility="gone"
tools:ignore="HardcodedText" />
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/label_0"
@ -22,7 +23,7 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="@string/monday_letter"/>
android:text="@string/monday_letter" />
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/label_1"
@ -30,7 +31,7 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="@string/tuesday_letter"/>
android:text="@string/tuesday_letter" />
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/label_2"
@ -38,7 +39,7 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="@string/wednesday_letter"/>
android:text="@string/wednesday_letter" />
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/label_3"
@ -46,7 +47,7 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="@string/thursday_letter"/>
android:text="@string/thursday_letter" />
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/label_4"
@ -54,7 +55,7 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="@string/friday_letter"/>
android:text="@string/friday_letter" />
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/label_5"
@ -62,7 +63,7 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="@string/saturday_letter"/>
android:text="@string/saturday_letter" />
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/label_6"
@ -70,6 +71,6 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="@string/sunday_letter"/>
android:text="@string/sunday_letter" />
</LinearLayout>

View File

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:paddingBottom="@dimen/small_margin"
android:paddingTop="@dimen/small_margin">
android:paddingTop="@dimen/small_margin"
android:paddingBottom="@dimen/small_margin">
<TextView
android:id="@+id/week_num"
@ -13,7 +13,8 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="#"/>
android:text="#"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/label_0"
@ -21,7 +22,7 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="@string/monday_letter"/>
android:text="@string/monday_letter" />
<TextView
android:id="@+id/label_1"
@ -29,7 +30,7 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="@string/tuesday_letter"/>
android:text="@string/tuesday_letter" />
<TextView
android:id="@+id/label_2"
@ -37,7 +38,7 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="@string/wednesday_letter"/>
android:text="@string/wednesday_letter" />
<TextView
android:id="@+id/label_3"
@ -45,7 +46,7 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="@string/thursday_letter"/>
android:text="@string/thursday_letter" />
<TextView
android:id="@+id/label_4"
@ -53,7 +54,7 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="@string/friday_letter"/>
android:text="@string/friday_letter" />
<TextView
android:id="@+id/label_5"
@ -61,7 +62,7 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="@string/saturday_letter"/>
android:text="@string/saturday_letter" />
<TextView
android:id="@+id/label_6"
@ -69,6 +70,6 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="@string/sunday_letter"/>
android:text="@string/sunday_letter" />
</LinearLayout>

View File

@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<com.simplemobiletools.commons.views.MyViewPager
xmlns:android="http://schemas.android.com/apk/res/android"
<com.simplemobiletools.commons.views.MyViewPager xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/fragment_days_viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true"
android:focusable="true"/>
android:focusable="true" />

View File

@ -1,17 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/month_calendar_holder"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="@dimen/medium_margin">
<include layout="@layout/top_navigation"/>
<include layout="@layout/top_navigation" />
<com.simplemobiletools.calendar.pro.views.MonthViewWrapper
android:id="@+id/month_view_wrapper"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/top_left_arrow"/>
android:layout_below="@+id/top_left_arrow" />
</RelativeLayout>

View File

@ -38,9 +38,10 @@
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:background="?attr/selectableItemBackground"
android:padding="@dimen/normal_margin"
android:textSize="@dimen/actionbar_text_size"
tools:text="8/5/2021" />
android:paddingTop="@dimen/normal_margin"
android:paddingBottom="@dimen/small_margin"
android:textSize="22sp"
tools:text="November 19" />
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/month_day_no_events_placeholder"

View File

@ -163,6 +163,7 @@
android:layout_weight="1"
android:gravity="center_horizontal"
android:orientation="vertical" />
</LinearLayout>
<LinearLayout
@ -235,6 +236,7 @@
android:layout_weight="1"
android:gravity="center_horizontal"
android:orientation="vertical" />
</LinearLayout>
<LinearLayout
@ -307,6 +309,7 @@
android:layout_weight="1"
android:gravity="center_horizontal"
android:orientation="vertical" />
</LinearLayout>
<LinearLayout
@ -379,6 +382,7 @@
android:layout_weight="1"
android:gravity="center_horizontal"
android:orientation="vertical" />
</LinearLayout>
<LinearLayout
@ -451,6 +455,7 @@
android:layout_weight="1"
android:gravity="center_horizontal"
android:orientation="vertical" />
</LinearLayout>
<LinearLayout
@ -523,6 +528,7 @@
android:layout_weight="1"
android:gravity="center_horizontal"
android:orientation="vertical" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>

View File

@ -102,6 +102,7 @@
android:background="?attr/selectableItemBackground"
android:gravity="center_horizontal"
android:orientation="vertical" />
</LinearLayout>
<LinearLayout
@ -182,6 +183,7 @@
android:background="?attr/selectableItemBackground"
android:gravity="center_horizontal"
android:orientation="vertical" />
</LinearLayout>
<LinearLayout
@ -261,6 +263,7 @@
android:background="?attr/selectableItemBackground"
android:gravity="center_horizontal"
android:orientation="vertical" />
</LinearLayout>
<LinearLayout
@ -341,6 +344,7 @@
android:background="?attr/selectableItemBackground"
android:gravity="center_horizontal"
android:orientation="vertical" />
</LinearLayout>
<LinearLayout
@ -421,6 +425,7 @@
android:background="?attr/selectableItemBackground"
android:gravity="center_horizontal"
android:orientation="vertical" />
</LinearLayout>
<LinearLayout
@ -500,6 +505,7 @@
android:background="?attr/selectableItemBackground"
android:gravity="center_horizontal"
android:orientation="vertical" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>

View File

@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<com.simplemobiletools.commons.views.MyViewPager
xmlns:android="http://schemas.android.com/apk/res/android"
<com.simplemobiletools.commons.views.MyViewPager xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/fragment_months_viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true"
android:focusable="true"/>
android:focusable="true" />

View File

@ -28,9 +28,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:orientation="horizontal">
android:orientation="horizontal" />
</LinearLayout>
</RelativeLayout>
</com.simplemobiletools.calendar.pro.views.MyScrollView>
@ -55,8 +54,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/week_letters_holder"
android:orientation="vertical">
android:orientation="vertical" />
</LinearLayout>
</RelativeLayout>
</RelativeLayout>

View File

@ -157,6 +157,7 @@
android:layout_height="match_parent"
android:layout_below="@+id/month_6_label"
app:days="30" />
</RelativeLayout>
</TableRow>
@ -183,6 +184,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/month_7_label" />
</RelativeLayout>
<RelativeLayout
@ -286,6 +288,7 @@
android:layout_below="@+id/month_11_label"
android:layout_marginStart="@dimen/yearly_month_padding"
app:days="30" />
</RelativeLayout>
<RelativeLayout

View File

@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<com.simplemobiletools.commons.views.MyViewPager
xmlns:android="http://schemas.android.com/apk/res/android"
<com.simplemobiletools.commons.views.MyViewPager xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/fragment_years_viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true"
android:focusable="true"/>
android:focusable="true" />

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/event_attendee_holder"
android:layout_width="match_parent"
@ -20,7 +19,7 @@
android:maxLines="1"
android:singleLine="true"
android:textCursorDrawable="@null"
android:textSize="@dimen/bigger_text_size"/>
android:textSize="@dimen/bigger_text_size" />
<RelativeLayout
android:id="@+id/event_contact_attendee"
@ -36,7 +35,7 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_margin="@dimen/tiny_margin"
android:adjustViewBounds="true"/>
android:adjustViewBounds="true" />
<ImageView
android:id="@+id/event_contact_status_image"
@ -48,7 +47,7 @@
android:background="@drawable/attendee_status_circular_background"
android:padding="@dimen/tiny_margin"
android:src="@drawable/ic_question_yellow"
android:visibility="gone"/>
android:visibility="gone" />
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/event_contact_name"
@ -61,7 +60,7 @@
android:ellipsize="end"
android:lines="1"
android:textSize="@dimen/bigger_text_size"
tools:text="Simple Mobile Tools"/>
tools:text="Simple Mobile Tools" />
<ImageView
android:id="@+id/event_contact_dismiss"
@ -73,7 +72,7 @@
android:alpha="0.8"
android:background="?attr/selectableItemBackgroundBorderless"
android:padding="@dimen/small_margin"
android:src="@drawable/ic_cross_vector"/>
android:src="@drawable/ic_cross_vector" />
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/event_contact_me_status"
@ -87,7 +86,7 @@
android:gravity="end"
android:lines="1"
android:textSize="@dimen/bigger_text_size"
tools:text="@string/invited"/>
tools:text="@string/invited" />
</RelativeLayout>
</RelativeLayout>

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/item_autocomplete_holder"
@ -17,7 +16,7 @@
android:layout_height="@dimen/avatar_size"
android:layout_margin="@dimen/tiny_margin"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/item_autocomplete_email"
@ -34,6 +33,6 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/item_autocomplete_image"
app:layout_constraintTop_toTopOf="parent"
tools:text="hello@simplemobiletools.com"/>
tools:text="hello@simplemobiletools.com" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/event_item_frame"
android:layout_width="match_parent"
@ -25,18 +24,16 @@
android:layout_toStartOf="@+id/event_type_color"
android:paddingStart="@dimen/medium_margin"
android:paddingEnd="@dimen/medium_margin"
tools:text="Event type"/>
tools:text="Event type" />
<ImageView
android:id="@+id/event_type_color"
android:layout_width="@dimen/color_sample_size"
android:layout_height="@dimen/color_sample_size"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginEnd="@dimen/medium_margin"
android:layout_marginRight="@dimen/medium_margin"
android:clickable="false"/>
android:clickable="false" />
</RelativeLayout>
</FrameLayout>

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/item_select_time_zone_holder"
android:layout_width="match_parent"

View File

@ -1,9 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
xmlns:android="http://schemas.android.com/apk/res/android"
<com.simplemobiletools.commons.views.MyAppCompatCheckbox xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/my_checkbox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:paddingBottom="@dimen/activity_margin"
android:paddingTop="@dimen/activity_margin"/>
android:paddingTop="@dimen/activity_margin"
android:paddingBottom="@dimen/activity_margin" />

Some files were not shown because too many files have changed in this diff Show More