diff --git a/CHANGELOG.md b/CHANGELOG.md index 3582dc988..d1f23cd8b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,13 @@ Changelog ========== +Version 6.9.2 *(2020-04-17)* +---------------------------- + + * Fixed some .ics file importing related glitches + * Corrected and added some UK holidays + * Added many UI and translation improvements + Version 6.9.1 *(2020-03-25)* ---------------------------- diff --git a/app/build.gradle b/app/build.gradle index 5515aa3ec..e9bcb4f5e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -18,8 +18,8 @@ android { applicationId "com.simplemobiletools.calendar.pro" minSdkVersion 21 targetSdkVersion 29 - versionCode 174 - versionName "6.9.1" + versionCode 175 + versionName "6.9.2" multiDexEnabled true setProperty("archivesBaseName", "calendar") vectorDrawables.useSupportLibrary = true @@ -64,7 +64,7 @@ android { } dependencies { - implementation 'com.simplemobiletools:commons:5.25.22' + implementation 'com.simplemobiletools:commons:5.27.5' implementation 'joda-time:joda-time:2.10.1' implementation 'androidx.multidex:multidex:2.0.1' implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta4' diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index cee3b05d5..65b7073a5 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -94,6 +94,15 @@ + + + + + + + + + + + + + + diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/EventActivity.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/EventActivity.kt index 3db68d31b..67609ade1 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/EventActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/EventActivity.kt @@ -302,7 +302,7 @@ class EventActivity : SimpleActivity() { mRepeatLimit = getLong(REPEAT_LIMIT) mAttendees = Gson().fromJson>(getString(ATTENDEES), object : TypeToken>() {}.type) - ?: ArrayList() + ?: ArrayList() mEventTypeId = getLong(EVENT_TYPE_ID) mEventCalendarId = getInt(EVENT_CALENDAR_ID) @@ -732,8 +732,8 @@ class EventActivity : SimpleActivity() { private fun showReminderTypePicker(currentValue: Int, callback: (Int) -> Unit) { val items = arrayListOf( - RadioItem(REMINDER_NOTIFICATION, getString(R.string.notification)), - RadioItem(REMINDER_EMAIL, getString(R.string.email)) + RadioItem(REMINDER_NOTIFICATION, getString(R.string.notification)), + RadioItem(REMINDER_EMAIL, getString(R.string.email)) ) RadioGroupDialog(this, items, currentValue) { callback(it as Int) @@ -809,7 +809,7 @@ class EventActivity : SimpleActivity() { private fun getCalendarId() = if (mEvent.source == SOURCE_SIMPLE_CALENDAR) config.lastUsedCaldavCalendarId else mEvent.getCalDAVCalendarId() private fun getCalendarWithId(calendars: List, calendarId: Int): CalDAVCalendar? = - calendars.firstOrNull { it.id == calendarId } + calendars.firstOrNull { it.id == calendarId } private fun updateCurrentCalendarInfo(currentCalendar: CalDAVCalendar?) { event_type_image.beVisibleIf(currentCalendar == null) @@ -852,8 +852,8 @@ class EventActivity : SimpleActivity() { private fun resetTime() { if (mEventEndDateTime.isBefore(mEventStartDateTime) && - mEventStartDateTime.dayOfMonth() == mEventEndDateTime.dayOfMonth() && - mEventStartDateTime.monthOfYear() == mEventEndDateTime.monthOfYear()) { + mEventStartDateTime.dayOfMonth() == mEventEndDateTime.dayOfMonth() && + mEventStartDateTime.monthOfYear() == mEventEndDateTime.monthOfYear()) { mEventEndDateTime = mEventEndDateTime.withTime(mEventStartDateTime.hourOfDay, mEventStartDateTime.minuteOfHour, mEventStartDateTime.secondOfMinute, 0) updateEndTimeText() @@ -960,9 +960,9 @@ class EventActivity : SimpleActivity() { } var reminders = arrayListOf( - Reminder(mReminder1Minutes, mReminder1Type), - Reminder(mReminder2Minutes, mReminder2Type), - Reminder(mReminder3Minutes, mReminder3Type) + Reminder(mReminder1Minutes, mReminder1Type), + Reminder(mReminder2Minutes, mReminder2Type), + Reminder(mReminder3Minutes, mReminder3Type) ) reminders = reminders.filter { it.minutes != REMINDER_OFF }.sortedBy { it.minutes }.toMutableList() as ArrayList @@ -1137,7 +1137,7 @@ class EventActivity : SimpleActivity() { hideKeyboard() config.backgroundColor.getContrastColor() val datepicker = DatePickerDialog(this, mDialogTheme, startDateSetListener, mEventStartDateTime.year, mEventStartDateTime.monthOfYear - 1, - mEventStartDateTime.dayOfMonth) + mEventStartDateTime.dayOfMonth) datepicker.datePicker.firstDayOfWeek = if (config.isSundayFirst) Calendar.SUNDAY else Calendar.MONDAY datepicker.show() @@ -1151,7 +1151,7 @@ class EventActivity : SimpleActivity() { private fun setupEndDate() { hideKeyboard() val datepicker = DatePickerDialog(this, mDialogTheme, endDateSetListener, mEventEndDateTime.year, mEventEndDateTime.monthOfYear - 1, - mEventEndDateTime.dayOfMonth) + mEventEndDateTime.dayOfMonth) datepicker.datePicker.firstDayOfWeek = if (config.isSundayFirst) Calendar.SUNDAY else Calendar.MONDAY datepicker.show() @@ -1373,9 +1373,9 @@ class EventActivity : SimpleActivity() { if (attendee.isMe) { event_contact_attendee.setOnClickListener { val items = arrayListOf( - RadioItem(Attendees.ATTENDEE_STATUS_ACCEPTED, getString(R.string.going)), - RadioItem(Attendees.ATTENDEE_STATUS_DECLINED, getString(R.string.not_going)), - RadioItem(Attendees.ATTENDEE_STATUS_TENTATIVE, getString(R.string.maybe_going)) + RadioItem(Attendees.ATTENDEE_STATUS_ACCEPTED, getString(R.string.going)), + RadioItem(Attendees.ATTENDEE_STATUS_DECLINED, getString(R.string.not_going)), + RadioItem(Attendees.ATTENDEE_STATUS_TENTATIVE, getString(R.string.maybe_going)) ) RadioGroupDialog(this@EventActivity, items, attendee.status) { @@ -1448,13 +1448,13 @@ class EventActivity : SimpleActivity() { val contacts = ArrayList() val uri = Data.CONTENT_URI val projection = arrayOf( - Data.CONTACT_ID, - StructuredName.PREFIX, - StructuredName.GIVEN_NAME, - StructuredName.MIDDLE_NAME, - StructuredName.FAMILY_NAME, - StructuredName.SUFFIX, - StructuredName.PHOTO_THUMBNAIL_URI) + Data.CONTACT_ID, + StructuredName.PREFIX, + StructuredName.GIVEN_NAME, + StructuredName.MIDDLE_NAME, + StructuredName.FAMILY_NAME, + StructuredName.SUFFIX, + StructuredName.PHOTO_THUMBNAIL_URI) val selection = "${Data.MIMETYPE} = ?" val selectionArgs = arrayOf(StructuredName.CONTENT_ITEM_TYPE) @@ -1482,8 +1482,8 @@ class EventActivity : SimpleActivity() { val contacts = ArrayList() val uri = CommonDataKinds.Email.CONTENT_URI val projection = arrayOf( - Data.CONTACT_ID, - CommonDataKinds.Email.DATA + Data.CONTACT_ID, + CommonDataKinds.Email.DATA ) queryCursor(uri, projection) { cursor -> @@ -1500,7 +1500,7 @@ class EventActivity : SimpleActivity() { event_show_on_map.applyColorFilter(getAdjustedPrimaryColor()) val textColor = config.textColor arrayOf(event_time_image, event_time_zone_image, event_repetition_image, event_reminder_image, event_type_image, event_caldav_calendar_image, - event_reminder_1_type, event_reminder_2_type, event_reminder_3_type, event_attendees_image).forEach { + event_reminder_1_type, event_reminder_2_type, event_reminder_3_type, event_attendees_image).forEach { it.applyColorFilter(textColor) } } diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/MainActivity.kt index 9280193ac..93e076112 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/MainActivity.kt @@ -126,7 +126,7 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener { override fun onResume() { super.onResume() if (mStoredTextColor != config.textColor || mStoredBackgroundColor != config.backgroundColor || mStoredPrimaryColor != config.primaryColor - || mStoredDayCode != Formatter.getTodayCode() || mStoredDimPastEvents != config.dimPastEvents) { + || mStoredDayCode != Formatter.getTodayCode() || mStoredDimPastEvents != config.dimPastEvents) { updateViewPager() } @@ -329,11 +329,11 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener { val intent = Intent(this, SplashActivity::class.java) intent.action = SHORTCUT_NEW_EVENT val shortcut = ShortcutInfo.Builder(this, "new_event") - .setShortLabel(newEvent) - .setLongLabel(newEvent) - .setIcon(Icon.createWithBitmap(bmp)) - .setIntent(intent) - .build() + .setShortLabel(newEvent) + .setLongLabel(newEvent) + .setIcon(Icon.createWithBitmap(bmp)) + .setIntent(intent) + .build() try { manager.dynamicShortcuts = Arrays.asList(shortcut) @@ -407,11 +407,11 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener { private fun showViewDialog() { val items = arrayListOf( - RadioItem(DAILY_VIEW, getString(R.string.daily_view)), - RadioItem(WEEKLY_VIEW, getString(R.string.weekly_view)), - RadioItem(MONTHLY_VIEW, getString(R.string.monthly_view)), - RadioItem(YEARLY_VIEW, getString(R.string.yearly_view)), - RadioItem(EVENTS_LIST_VIEW, getString(R.string.simple_event_list))) + RadioItem(DAILY_VIEW, getString(R.string.daily_view)), + RadioItem(WEEKLY_VIEW, getString(R.string.weekly_view)), + RadioItem(MONTHLY_VIEW, getString(R.string.monthly_view)), + RadioItem(YEARLY_VIEW, getString(R.string.yearly_view)), + RadioItem(EVENTS_LIST_VIEW, getString(R.string.simple_event_list))) RadioGroupDialog(this, items, config.storedView) { calendar_fab.beVisibleIf(it as Int != YEARLY_VIEW) @@ -558,9 +558,9 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener { var eventsFound = 0 val uri = Data.CONTENT_URI val projection = arrayOf(Contacts.DISPLAY_NAME, - CommonDataKinds.Event.CONTACT_ID, - CommonDataKinds.Event.CONTACT_LAST_UPDATED_TIMESTAMP, - CommonDataKinds.Event.START_DATE) + CommonDataKinds.Event.CONTACT_ID, + CommonDataKinds.Event.CONTACT_LAST_UPDATED_TIMESTAMP, + CommonDataKinds.Event.START_DATE) val selection = "${Data.MIMETYPE} = ? AND ${CommonDataKinds.Event.TYPE} = ?" val type = if (birthdays) CommonDataKinds.Event.TYPE_BIRTHDAY else CommonDataKinds.Event.TYPE_ANNIVERSARY @@ -592,8 +592,8 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener { val source = if (birthdays) SOURCE_CONTACT_BIRTHDAY else SOURCE_CONTACT_ANNIVERSARY val lastUpdated = cursor.getLongValue(CommonDataKinds.Event.CONTACT_LAST_UPDATED_TIMESTAMP) val event = Event(null, timestamp, timestamp, name, reminder1Minutes = reminders[0], reminder2Minutes = reminders[1], - reminder3Minutes = reminders[2], importId = contactId, timeZone = DateTimeZone.getDefault().id, flags = FLAG_ALL_DAY, - repeatInterval = YEAR, repeatRule = REPEAT_SAME_DAY, eventType = eventTypeId, source = source, lastUpdated = lastUpdated) + reminder3Minutes = reminders[2], importId = contactId, timeZone = DateTimeZone.getDefault().id, flags = FLAG_ALL_DAY, + repeatInterval = YEAR, repeatRule = REPEAT_SAME_DAY, eventType = eventTypeId, source = source, lastUpdated = lastUpdated) val importIDsToDelete = ArrayList() for ((key, value) in importIDs) { @@ -846,15 +846,15 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener { val licenses = LICENSE_JODA val faqItems = arrayListOf( - FAQItem(R.string.faq_1_title_commons, R.string.faq_1_text_commons), - FAQItem(R.string.faq_4_title_commons, R.string.faq_4_text_commons), - FAQItem(R.string.faq_1_title, R.string.faq_1_text), - FAQItem(R.string.faq_2_title, R.string.faq_2_text), - FAQItem(R.string.faq_3_title, R.string.faq_3_text), - FAQItem(R.string.faq_4_title, R.string.faq_4_text), - FAQItem(R.string.faq_2_title_commons, R.string.faq_2_text_commons), - FAQItem(R.string.faq_6_title_commons, R.string.faq_6_text_commons), - FAQItem(R.string.faq_7_title_commons, R.string.faq_7_text_commons)) + FAQItem(R.string.faq_1_title_commons, R.string.faq_1_text_commons), + FAQItem(R.string.faq_4_title_commons, R.string.faq_4_text_commons), + FAQItem(R.string.faq_1_title, R.string.faq_1_text), + FAQItem(R.string.faq_2_title, R.string.faq_2_text), + FAQItem(R.string.faq_3_title, R.string.faq_3_text), + FAQItem(R.string.faq_4_title, R.string.faq_4_text), + FAQItem(R.string.faq_2_title_commons, R.string.faq_2_text_commons), + FAQItem(R.string.faq_6_title_commons, R.string.faq_6_text_commons), + FAQItem(R.string.faq_7_title_commons, R.string.faq_7_text_commons)) startAboutActivity(R.string.app_name, licenses, BuildConfig.VERSION_NAME, faqItems, true) } diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/SettingsActivity.kt index ca5075a33..699e10d1a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/SettingsActivity.kt @@ -126,7 +126,7 @@ 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 { + new_events_label, migrating_label).forEach { it.setTextColor(adjustedPrimaryColor) } } @@ -325,16 +325,16 @@ class SettingsActivity : SimpleActivity() { settings_reminder_sound_holder.setOnClickListener { SelectAlarmSoundDialog(this, config.reminderSoundUri, config.reminderAudioStream, GET_RINGTONE_URI, ALARM_SOUND_TYPE_NOTIFICATION, false, - onAlarmPicked = { - if (it != null) { - updateReminderSound(it) - } - }, onAlarmSoundDeleted = { - if (it.uri == config.reminderSoundUri) { - val defaultAlarm = getDefaultAlarmSound(ALARM_SOUND_TYPE_NOTIFICATION) - updateReminderSound(defaultAlarm) - } - }) + onAlarmPicked = { + if (it != null) { + updateReminderSound(it) + } + }, onAlarmSoundDeleted = { + if (it.uri == config.reminderSoundUri) { + val defaultAlarm = getDefaultAlarmSound(ALARM_SOUND_TYPE_NOTIFICATION) + updateReminderSound(defaultAlarm) + } + }) } } @@ -348,10 +348,10 @@ class SettingsActivity : SimpleActivity() { settings_reminder_audio_stream.text = getAudioStreamText() settings_reminder_audio_stream_holder.setOnClickListener { val items = arrayListOf( - RadioItem(AudioManager.STREAM_ALARM, getString(R.string.alarm_stream)), - RadioItem(AudioManager.STREAM_SYSTEM, getString(R.string.system_stream)), - RadioItem(AudioManager.STREAM_NOTIFICATION, getString(R.string.notification_stream)), - RadioItem(AudioManager.STREAM_RING, getString(R.string.ring_stream))) + RadioItem(AudioManager.STREAM_ALARM, getString(R.string.alarm_stream)), + RadioItem(AudioManager.STREAM_SYSTEM, getString(R.string.system_stream)), + RadioItem(AudioManager.STREAM_NOTIFICATION, getString(R.string.notification_stream)), + RadioItem(AudioManager.STREAM_RING, getString(R.string.ring_stream))) RadioGroupDialog(this@SettingsActivity, items, config.reminderAudioStream) { config.reminderAudioStream = it as Int @@ -484,10 +484,10 @@ class SettingsActivity : SimpleActivity() { settings_font_size.text = getFontSizeText() settings_font_size_holder.setOnClickListener { val items = arrayListOf( - RadioItem(FONT_SIZE_SMALL, getString(R.string.small)), - RadioItem(FONT_SIZE_MEDIUM, getString(R.string.medium)), - RadioItem(FONT_SIZE_LARGE, getString(R.string.large)), - RadioItem(FONT_SIZE_EXTRA_LARGE, getString(R.string.extra_large))) + RadioItem(FONT_SIZE_SMALL, getString(R.string.small)), + RadioItem(FONT_SIZE_MEDIUM, getString(R.string.medium)), + RadioItem(FONT_SIZE_LARGE, getString(R.string.large)), + RadioItem(FONT_SIZE_EXTRA_LARGE, getString(R.string.extra_large))) RadioGroupDialog(this@SettingsActivity, items, config.fontSize) { config.fontSize = it as Int @@ -510,12 +510,12 @@ class SettingsActivity : SimpleActivity() { settings_list_widget_view_to_open.text = getDefaultViewText() settings_list_widget_view_to_open_holder.setOnClickListener { val items = arrayListOf( - RadioItem(DAILY_VIEW, getString(R.string.daily_view)), - RadioItem(WEEKLY_VIEW, getString(R.string.weekly_view)), - RadioItem(MONTHLY_VIEW, getString(R.string.monthly_view)), - RadioItem(YEARLY_VIEW, getString(R.string.yearly_view)), - RadioItem(EVENTS_LIST_VIEW, getString(R.string.simple_event_list)), - RadioItem(LAST_VIEW, getString(R.string.last_view))) + RadioItem(DAILY_VIEW, getString(R.string.daily_view)), + RadioItem(WEEKLY_VIEW, getString(R.string.weekly_view)), + RadioItem(MONTHLY_VIEW, getString(R.string.monthly_view)), + RadioItem(YEARLY_VIEW, getString(R.string.yearly_view)), + RadioItem(EVENTS_LIST_VIEW, getString(R.string.simple_event_list)), + RadioItem(LAST_VIEW, getString(R.string.last_view))) RadioGroupDialog(this@SettingsActivity, items, config.listWidgetViewToOpen) { config.listWidgetViewToOpen = it as Int diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/SimpleActivity.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/SimpleActivity.kt index dba3343f6..ed185a195 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/SimpleActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/SimpleActivity.kt @@ -16,25 +16,25 @@ open class SimpleActivity : BaseSimpleActivity() { var calDAVRefreshCallback: (() -> Unit)? = null override fun getAppIconIDs() = arrayListOf( - R.mipmap.ic_launcher_red, - R.mipmap.ic_launcher_pink, - R.mipmap.ic_launcher_purple, - R.mipmap.ic_launcher_deep_purple, - R.mipmap.ic_launcher_indigo, - R.mipmap.ic_launcher_blue, - R.mipmap.ic_launcher_light_blue, - R.mipmap.ic_launcher_cyan, - R.mipmap.ic_launcher_teal, - R.mipmap.ic_launcher_green, - R.mipmap.ic_launcher_light_green, - R.mipmap.ic_launcher_lime, - R.mipmap.ic_launcher_yellow, - R.mipmap.ic_launcher_amber, - R.mipmap.ic_launcher, - R.mipmap.ic_launcher_deep_orange, - R.mipmap.ic_launcher_brown, - R.mipmap.ic_launcher_blue_grey, - R.mipmap.ic_launcher_grey_black + R.mipmap.ic_launcher_red, + R.mipmap.ic_launcher_pink, + R.mipmap.ic_launcher_purple, + R.mipmap.ic_launcher_deep_purple, + R.mipmap.ic_launcher_indigo, + R.mipmap.ic_launcher_blue, + R.mipmap.ic_launcher_light_blue, + R.mipmap.ic_launcher_cyan, + R.mipmap.ic_launcher_teal, + R.mipmap.ic_launcher_green, + R.mipmap.ic_launcher_light_green, + R.mipmap.ic_launcher_lime, + R.mipmap.ic_launcher_yellow, + R.mipmap.ic_launcher_amber, + R.mipmap.ic_launcher, + R.mipmap.ic_launcher_deep_orange, + R.mipmap.ic_launcher_brown, + R.mipmap.ic_launcher_blue_grey, + R.mipmap.ic_launcher_grey_black ) override fun getAppLauncherName() = getString(R.string.app_launcher_name) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/WidgetDateConfigureActivity.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/WidgetDateConfigureActivity.kt new file mode 100644 index 000000000..8852bb13d --- /dev/null +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/WidgetDateConfigureActivity.kt @@ -0,0 +1,141 @@ +package com.simplemobiletools.calendar.pro.activities + +import android.app.Activity +import android.appwidget.AppWidgetManager +import android.content.Intent +import android.graphics.Color +import android.os.Bundle +import android.widget.SeekBar +import com.simplemobiletools.calendar.pro.R +import com.simplemobiletools.calendar.pro.extensions.config +import com.simplemobiletools.calendar.pro.helpers.Formatter +import com.simplemobiletools.calendar.pro.helpers.LOW_ALPHA +import com.simplemobiletools.calendar.pro.helpers.MyWidgetDateProvider +import com.simplemobiletools.commons.dialogs.ColorPickerDialog +import com.simplemobiletools.commons.extensions.adjustAlpha +import com.simplemobiletools.commons.extensions.applyColorFilter +import com.simplemobiletools.commons.extensions.setFillWithStroke +import kotlinx.android.synthetic.main.widget_config_date.* + +class WidgetDateConfigureActivity : SimpleActivity() { + private var mBgAlpha = 0f + private var mWidgetId = 0 + private var mBgColorWithoutTransparency = 0 + private var mBgColor = 0 + private var mTextColorWithoutTransparency = 0 + private var mTextColor = 0 + private var mWeakTextColor = 0 + private var mPrimaryColor = 0 + + public override fun onCreate(savedInstanceState: Bundle?) { + useDynamicTheme = false + super.onCreate(savedInstanceState) + setResult(Activity.RESULT_CANCELED) + setContentView(R.layout.widget_config_date) + initVariables() + + val extras = intent.extras + if (extras != null) + mWidgetId = extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID) + + if (mWidgetId == AppWidgetManager.INVALID_APPWIDGET_ID) + finish() + + config_save.setOnClickListener { saveConfig() } + config_bg_color.setOnClickListener { pickBackgroundColor() } + config_text_color.setOnClickListener { pickTextColor() } + config_bg_seekbar.setColors(mTextColor, mPrimaryColor, mPrimaryColor) + widget_date_label.text = Formatter.getTodayDayNumber() + widget_month_label.text = Formatter.getCurrentMonthShort() + } + + override fun onResume() { + super.onResume() + window.decorView.setBackgroundColor(0) + } + + private fun initVariables() { + mTextColorWithoutTransparency = config.widgetTextColor + updateColors() + + mBgColor = config.widgetBgColor + mBgAlpha = Color.alpha(mBgColor) / 255.toFloat() + + mBgColorWithoutTransparency = Color.rgb(Color.red(mBgColor), Color.green(mBgColor), Color.blue(mBgColor)) + config_bg_seekbar.setOnSeekBarChangeListener(bgSeekbarChangeListener) + config_bg_seekbar.progress = (mBgAlpha * 100).toInt() + updateBgColor() + } + + private fun saveConfig() { + storeWidgetColors() + requestWidgetUpdate() + + Intent().apply { + putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, mWidgetId) + setResult(Activity.RESULT_OK, this) + } + finish() + } + + private fun storeWidgetColors() { + config.apply { + widgetBgColor = mBgColor + widgetTextColor = mTextColorWithoutTransparency + } + } + + private fun pickBackgroundColor() { + ColorPickerDialog(this, mBgColorWithoutTransparency) { wasPositivePressed, color -> + if (wasPositivePressed) { + mBgColorWithoutTransparency = color + updateBgColor() + } + } + } + + private fun pickTextColor() { + ColorPickerDialog(this, mTextColor) { wasPositivePressed, color -> + if (wasPositivePressed) { + mTextColorWithoutTransparency = color + updateColors() + } + } + } + + private fun requestWidgetUpdate() { + Intent(AppWidgetManager.ACTION_APPWIDGET_UPDATE, null, this, MyWidgetDateProvider::class.java).apply { + putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, intArrayOf(mWidgetId)) + sendBroadcast(this) + } + } + + private fun updateColors() { + mTextColor = mTextColorWithoutTransparency + mWeakTextColor = mTextColorWithoutTransparency.adjustAlpha(LOW_ALPHA) + mPrimaryColor = config.primaryColor + + config_text_color.setFillWithStroke(mTextColor, Color.BLACK) + config_save.setTextColor(mTextColor) + widget_date_label.setTextColor(mTextColor) + widget_month_label.setTextColor(mTextColor) + } + + private fun updateBgColor() { + mBgColor = mBgColorWithoutTransparency.adjustAlpha(mBgAlpha) + config_date_time_wrapper.background.applyColorFilter(mBgColor) + config_bg_color.setFillWithStroke(mBgColor, Color.BLACK) + config_save.setBackgroundColor(mBgColor) + } + + private val bgSeekbarChangeListener = object : SeekBar.OnSeekBarChangeListener { + override fun onProgressChanged(seekBar: SeekBar, progress: Int, fromUser: Boolean) { + mBgAlpha = progress.toFloat() / 100.toFloat() + updateBgColor() + } + + override fun onStartTrackingTouch(seekBar: SeekBar) {} + + override fun onStopTrackingTouch(seekBar: SeekBar) {} + } +} diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/WidgetListConfigureActivity.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/WidgetListConfigureActivity.kt index 8c76bb403..29f2c8f50 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/WidgetListConfigureActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/WidgetListConfigureActivity.kt @@ -17,6 +17,7 @@ import com.simplemobiletools.calendar.pro.models.ListItem import com.simplemobiletools.calendar.pro.models.ListSection import com.simplemobiletools.commons.dialogs.ColorPickerDialog import com.simplemobiletools.commons.extensions.adjustAlpha +import com.simplemobiletools.commons.extensions.applyColorFilter import com.simplemobiletools.commons.extensions.setFillWithStroke import com.simplemobiletools.commons.helpers.IS_CUSTOMIZING_COLORS import kotlinx.android.synthetic.main.widget_config_list.* @@ -128,7 +129,7 @@ class WidgetListConfigureActivity : SimpleActivity() { private fun updateBgColor() { mBgColor = mBgColorWithoutTransparency.adjustAlpha(mBgAlpha) - config_events_list.setBackgroundColor(mBgColor) + config_events_list.background.applyColorFilter(mBgColor) config_bg_color.setFillWithStroke(mBgColor, Color.BLACK) config_save.setBackgroundColor(mBgColor) } diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/WidgetMonthlyConfigureActivity.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/WidgetMonthlyConfigureActivity.kt index dc159f658..1b0302585 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/WidgetMonthlyConfigureActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/activities/WidgetMonthlyConfigureActivity.kt @@ -4,7 +4,6 @@ import android.app.Activity import android.appwidget.AppWidgetManager import android.content.Context import android.content.Intent -import android.content.res.Resources import android.graphics.Color import android.os.Bundle import android.widget.LinearLayout @@ -30,9 +29,7 @@ import kotlinx.android.synthetic.main.widget_config_monthly.* import org.joda.time.DateTime class WidgetMonthlyConfigureActivity : SimpleActivity(), MonthlyCalendar { - lateinit var mRes: Resources private var mDays: List? = null - private var mPackageName = "" private var dayLabelHeight = 0 private var mBgAlpha = 0f @@ -70,9 +67,6 @@ class WidgetMonthlyConfigureActivity : SimpleActivity(), MonthlyCalendar { } private fun initVariables() { - mPackageName = packageName - mRes = resources - mTextColorWithoutTransparency = config.widgetTextColor updateColors() @@ -146,7 +140,7 @@ class WidgetMonthlyConfigureActivity : SimpleActivity(), MonthlyCalendar { private fun updateBgColor() { mBgColor = mBgColorWithoutTransparency.adjustAlpha(mBgAlpha) - config_calendar.setBackgroundColor(mBgColor) + config_calendar.background.applyColorFilter(mBgColor) config_bg_color.setFillWithStroke(mBgColor, Color.BLACK) config_save.setBackgroundColor(mBgColor) } @@ -159,7 +153,7 @@ class WidgetMonthlyConfigureActivity : SimpleActivity(), MonthlyCalendar { week_num.beVisible() for (i in 0..5) { - findViewById(mRes.getIdentifier("week_num_$i", "id", mPackageName)).apply { + findViewById(resources.getIdentifier("week_num_$i", "id", packageName)).apply { text = "${mDays!![i * 7 + 3].weekOfYear}:" setTextColor(mTextColor) beVisible() @@ -167,14 +161,14 @@ class WidgetMonthlyConfigureActivity : SimpleActivity(), MonthlyCalendar { } } - val dividerMargin = mRes.displayMetrics.density.toInt() + val dividerMargin = resources.displayMetrics.density.toInt() for (i in 0 until len) { - findViewById(mRes.getIdentifier("day_$i", "id", mPackageName)).apply { + findViewById(resources.getIdentifier("day_$i", "id", packageName)).apply { val day = mDays!![i] removeAllViews() context.addDayNumber(mTextColor, day, this, dayLabelHeight) { dayLabelHeight = it } - context.addDayEvents(day, this, mRes, dividerMargin) + context.addDayEvents(day, this, resources, dividerMargin) } } } @@ -185,13 +179,9 @@ class WidgetMonthlyConfigureActivity : SimpleActivity(), MonthlyCalendar { updateBgColor() } - override fun onStartTrackingTouch(seekBar: SeekBar) { + override fun onStartTrackingTouch(seekBar: SeekBar) {} - } - - override fun onStopTrackingTouch(seekBar: SeekBar) { - - } + override fun onStopTrackingTouch(seekBar: SeekBar) {} } override fun updateMonthlyCalendar(context: Context, month: String, days: ArrayList, checkedEvents: Boolean, currTargetDate: DateTime) { @@ -204,7 +194,7 @@ class WidgetMonthlyConfigureActivity : SimpleActivity(), MonthlyCalendar { private fun updateLabels() { for (i in 0..6) { - findViewById(mRes.getIdentifier("label_$i", "id", mPackageName)).apply { + findViewById(resources.getIdentifier("label_$i", "id", packageName)).apply { setTextColor(mTextColor) } } diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/adapters/EventListWidgetAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/adapters/EventListWidgetAdapter.kt index cf779ea55..f71657f69 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/adapters/EventListWidgetAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/adapters/EventListWidgetAdapter.kt @@ -142,7 +142,7 @@ class EventListWidgetAdapter(val context: Context) : RemoteViewsService.RemoteVi } } - private fun getItemViewType(position: Int) = if (events[position] is ListEvent) ITEM_EVENT else ITEM_HEADER + private fun getItemViewType(position: Int) = if (events.getOrNull(position) is ListEvent) ITEM_EVENT else ITEM_HEADER override fun getLoadingView() = null diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/extensions/Context.kt index c57d5f99b..2b49865db 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/extensions/Context.kt @@ -56,6 +56,7 @@ fun Context.updateWidgets() { } updateListWidget() + updateDateWidget() } fun Context.updateListWidget() { @@ -69,6 +70,17 @@ fun Context.updateListWidget() { } } +fun Context.updateDateWidget() { + val widgetIDs = AppWidgetManager.getInstance(applicationContext).getAppWidgetIds(ComponentName(applicationContext, MyWidgetDateProvider::class.java)) + if (widgetIDs.isNotEmpty()) { + Intent(applicationContext, MyWidgetDateProvider::class.java).apply { + action = AppWidgetManager.ACTION_APPWIDGET_UPDATE + putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, widgetIDs) + sendBroadcast(this) + } + } +} + fun Context.scheduleAllEvents() { val events = eventsDB.getEventsAtReboot(getNowSeconds()) events.forEach { @@ -234,10 +246,10 @@ fun Context.getNotification(pendingIntent: PendingIntent, event: Event, content: val channelId = "simple_calendar_${config.lastReminderChannel}_${config.reminderAudioStream}_${event.eventType}" if (isOreoPlus()) { val audioAttributes = AudioAttributes.Builder() - .setUsage(AudioAttributes.USAGE_ALARM) - .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION) - .setLegacyStreamType(config.reminderAudioStream) - .build() + .setUsage(AudioAttributes.USAGE_ALARM) + .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION) + .setLegacyStreamType(config.reminderAudioStream) + .build() val name = eventTypesDB.getEventTypeWithId(event.eventType)?.getDisplayTitle() val importance = NotificationManager.IMPORTANCE_HIGH @@ -260,17 +272,17 @@ fun Context.getNotification(pendingIntent: PendingIntent, event: Event, content: val contentText = if (publicVersion) resources.getString(R.string.public_event_notification_text) else content val builder = NotificationCompat.Builder(this, channelId) - .setContentTitle(contentTitle) - .setContentText(contentText) - .setSmallIcon(R.drawable.ic_calendar_vector) - .setContentIntent(pendingIntent) - .setPriority(NotificationCompat.PRIORITY_MAX) - .setDefaults(Notification.DEFAULT_LIGHTS) - .setCategory(Notification.CATEGORY_EVENT) - .setAutoCancel(true) - .setSound(Uri.parse(soundUri), config.reminderAudioStream) - .setChannelId(channelId) - .addAction(R.drawable.ic_snooze_vector, getString(R.string.snooze), getSnoozePendingIntent(this, event)) + .setContentTitle(contentTitle) + .setContentText(contentText) + .setSmallIcon(R.drawable.ic_calendar_vector) + .setContentIntent(pendingIntent) + .setPriority(NotificationCompat.PRIORITY_MAX) + .setDefaults(Notification.DEFAULT_LIGHTS) + .setCategory(Notification.CATEGORY_EVENT) + .setAutoCancel(true) + .setSound(Uri.parse(soundUri), config.reminderAudioStream) + .setChannelId(channelId) + .addAction(R.drawable.ic_snooze_vector, getString(R.string.snooze), getSnoozePendingIntent(this, event)) if (config.vibrateOnReminder) { val vibrateArray = LongArray(2) { 500 } @@ -401,7 +413,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_filled) fun Context.addDayEvents(day: DayMonthly, linearLayout: LinearLayout, res: Resources, dividerMargin: Int) { val eventLayoutParams = LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) @@ -513,7 +525,6 @@ fun Context.refreshCalDAVCalendars(ids: String, showToasts: Boolean) { } } - fun Context.getWidgetFontSize() = when (config.fontSize) { FONT_SIZE_SMALL -> getWidgetSmallFontSize() FONT_SIZE_MEDIUM -> getWidgetMediumFontSize() diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/Formatter.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/Formatter.kt index 5a2dd697f..e24ffcf82 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/Formatter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/Formatter.kt @@ -13,6 +13,7 @@ object Formatter { const val DAYCODE_PATTERN = "YYYYMMdd" const val YEAR_PATTERN = "YYYY" const val TIME_PATTERN = "HHmmss" + private const val MONTH_PATTERN = "MMM" private const val DAY_PATTERN = "d" private const val DAY_OF_WEEK_PATTERN = "EEE" private const val LONGEST_PATTERN = "MMMM d YYYY (EEEE)" @@ -60,6 +61,10 @@ object Formatter { fun getTodayCode() = getDayCodeFromTS(getNowSeconds()) + fun getTodayDayNumber() = getDateTimeFromTS(getNowSeconds()).toString(DAY_PATTERN) + + fun getCurrentMonthShort() = getDateTimeFromTS(getNowSeconds()).toString(MONTH_PATTERN) + fun getHours(context: Context, dateTime: DateTime) = dateTime.toString(getHourPattern(context)) fun getTime(context: Context, dateTime: DateTime) = dateTime.toString(getTimePattern(context)) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/MyWidgetDateProvider.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/MyWidgetDateProvider.kt new file mode 100644 index 000000000..eef8a9ada --- /dev/null +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/MyWidgetDateProvider.kt @@ -0,0 +1,46 @@ +package com.simplemobiletools.calendar.pro.helpers + +import android.app.PendingIntent +import android.appwidget.AppWidgetManager +import android.appwidget.AppWidgetProvider +import android.content.ComponentName +import android.content.Context +import android.content.Intent +import android.widget.RemoteViews +import com.simplemobiletools.calendar.pro.R +import com.simplemobiletools.calendar.pro.activities.SplashActivity +import com.simplemobiletools.calendar.pro.extensions.config +import com.simplemobiletools.commons.extensions.applyColorFilter +import com.simplemobiletools.commons.extensions.getLaunchIntent +import com.simplemobiletools.commons.extensions.setText + +class MyWidgetDateProvider : AppWidgetProvider() { + private val OPEN_APP_INTENT_ID = 1 + + override fun onUpdate(context: Context, appWidgetManager: AppWidgetManager, appWidgetIds: IntArray) { + appWidgetManager.getAppWidgetIds(getComponentName(context)).forEach { + val views = RemoteViews(context.packageName, R.layout.widget_date).apply { + applyColorFilter(R.id.widget_date_background, context.config.widgetBgColor) + setText(R.id.widget_date_label, Formatter.getTodayDayNumber()) + setText(R.id.widget_month_label, Formatter.getCurrentMonthShort()) + + setTextColor(R.id.widget_date_label, context.config.widgetTextColor) + setTextColor(R.id.widget_month_label, context.config.widgetTextColor) + + setupAppOpenIntent(context, this) + appWidgetManager.updateAppWidget(it, this) + } + + appWidgetManager.notifyAppWidgetViewDataChanged(it, R.id.widget_date_holder) + } + } + + private fun getComponentName(context: Context) = ComponentName(context, MyWidgetDateProvider::class.java) + + private fun setupAppOpenIntent(context: Context, views: RemoteViews) { + (context.getLaunchIntent() ?: Intent(context, SplashActivity::class.java)).apply { + val pendingIntent = PendingIntent.getActivity(context, OPEN_APP_INTENT_ID, this, PendingIntent.FLAG_UPDATE_CURRENT) + views.setOnClickPendingIntent(R.id.widget_date_holder, pendingIntent) + } + } +} diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/MyWidgetListProvider.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/MyWidgetListProvider.kt index 5d288eec2..4f56d9d0b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/MyWidgetListProvider.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/MyWidgetListProvider.kt @@ -34,7 +34,7 @@ class MyWidgetListProvider : AppWidgetProvider() { val appWidgetManager = AppWidgetManager.getInstance(context) appWidgetManager.getAppWidgetIds(getComponentName(context)).forEach { val views = RemoteViews(context.packageName, R.layout.widget_event_list).apply { - setBackgroundColor(R.id.widget_event_list_holder, context.config.widgetBgColor) + applyColorFilter(R.id.widget_event_list_background, context.config.widgetBgColor) setTextColor(R.id.widget_event_list_empty, textColor) setTextSize(R.id.widget_event_list_empty, fontSize) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/MyWidgetMonthlyProvider.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/MyWidgetMonthlyProvider.kt index 7dd7300ca..d1a5138ba 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/MyWidgetMonthlyProvider.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/helpers/MyWidgetMonthlyProvider.kt @@ -124,7 +124,7 @@ class MyWidgetMonthlyProvider : AppWidgetProvider() { setupDayOpenIntent(context, views, id, day.code) day.dayEvents = day.dayEvents.asSequence().sortedWith(compareBy({ it.flags and FLAG_ALL_DAY == 0 }, { it.startTS }, { it.title })) - .toMutableList() as ArrayList + .toMutableList() as ArrayList day.dayEvents.forEach { var backgroundColor = it.color @@ -172,7 +172,7 @@ class MyWidgetMonthlyProvider : AppWidgetProvider() { val views = RemoteViews(context.packageName, R.layout.fragment_month_widget) views.setText(R.id.top_value, month) - views.setBackgroundColor(R.id.calendar_holder, context.config.widgetBgColor) + views.applyColorFilter(R.id.widget_month_background, context.config.widgetBgColor) views.setTextColor(R.id.top_value, textColor) views.setTextSize(R.id.top_value, largerFontSize) diff --git a/app/src/main/res/drawable-hdpi/img_widget_date_preview.png b/app/src/main/res/drawable-hdpi/img_widget_date_preview.png new file mode 100644 index 000000000..3e354bb29 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/img_widget_date_preview.png differ diff --git a/app/src/main/res/drawable-xhdpi/img_widget_date_preview.png b/app/src/main/res/drawable-xhdpi/img_widget_date_preview.png new file mode 100644 index 000000000..a73237a63 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/img_widget_date_preview.png differ diff --git a/app/src/main/res/drawable-xxhdpi/img_widget_date_preview.png b/app/src/main/res/drawable-xxhdpi/img_widget_date_preview.png new file mode 100644 index 000000000..5d1a63cb5 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/img_widget_date_preview.png differ diff --git a/app/src/main/res/drawable-xxxhdpi/img_widget_date_preview.png b/app/src/main/res/drawable-xxxhdpi/img_widget_date_preview.png new file mode 100644 index 000000000..5d1a63cb5 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/img_widget_date_preview.png differ diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index 328573932..93478b89c 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -1,6 +1,5 @@ - + android:text="@string/customize_colors" /> @@ -50,7 +49,7 @@ android:layout_height="wrap_content" android:layout_centerVertical="true" android:paddingStart="@dimen/medium_margin" - android:text="@string/manage_event_types"/> + android:text="@string/manage_event_types" /> @@ -72,7 +71,7 @@ android:background="@null" android:clickable="false" android:paddingStart="@dimen/medium_margin" - android:text="@string/use_english_language"/> + android:text="@string/use_english_language" /> @@ -94,7 +93,7 @@ android:background="@null" android:clickable="false" android:paddingStart="@dimen/medium_margin" - android:text="@string/use_24_hour_time_format"/> + android:text="@string/use_24_hour_time_format" /> @@ -116,7 +115,7 @@ android:background="@null" android:clickable="false" android:paddingStart="@dimen/medium_margin" - android:text="@string/sunday_first"/> + android:text="@string/sunday_first" /> @@ -125,10 +124,10 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="@dimen/bigger_margin" - android:layout_marginTop="@dimen/activity_margin" + android:layout_marginTop="@dimen/section_margin" android:text="@string/event_reminders" android:textAllCaps="true" - android:textSize="@dimen/smaller_text_size"/> + android:textSize="@dimen/smaller_text_size" /> + android:text="@string/vibrate" /> @@ -170,7 +169,7 @@ android:background="@null" android:clickable="false" android:paddingStart="@dimen/medium_margin" - android:text="@string/loop_reminders"/> + android:text="@string/loop_reminders" /> @@ -193,7 +192,7 @@ android:layout_toStartOf="@+id/settings_reminder_sound" android:paddingStart="@dimen/medium_margin" android:paddingEnd="@dimen/medium_margin" - android:text="@string/reminder_sound"/> + android:text="@string/reminder_sound" /> + android:clickable="false" /> @@ -224,7 +223,7 @@ android:layout_toStartOf="@+id/settings_reminder_audio_stream" android:paddingStart="@dimen/medium_margin" android:paddingEnd="@dimen/medium_margin" - android:text="@string/reminder_stream"/> + android:text="@string/reminder_stream" /> + android:clickable="false" /> @@ -255,7 +254,7 @@ android:background="@null" android:clickable="false" android:paddingStart="@dimen/medium_margin" - android:text="@string/use_same_snooze"/> + android:text="@string/use_same_snooze" /> @@ -278,7 +277,7 @@ android:layout_toStartOf="@+id/settings_snooze_time" android:paddingStart="@dimen/medium_margin" android:paddingEnd="@dimen/medium_margin" - android:text="@string/snooze_time"/> + android:text="@string/snooze_time" /> + android:clickable="false" /> @@ -296,10 +295,10 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="@dimen/bigger_margin" - android:layout_marginTop="@dimen/activity_margin" + android:layout_marginTop="@dimen/section_margin" android:text="@string/caldav" android:textAllCaps="true" - android:textSize="@dimen/smaller_text_size"/> + android:textSize="@dimen/smaller_text_size" /> + android:text="@string/caldav_sync" /> @@ -341,7 +340,7 @@ android:background="@null" android:clickable="false" android:paddingStart="@dimen/medium_margin" - android:text="@string/enable_pull_to_refresh"/> + android:text="@string/enable_pull_to_refresh" /> @@ -363,7 +362,7 @@ android:layout_centerVertical="true" android:paddingStart="@dimen/medium_margin" android:paddingEnd="@dimen/medium_margin" - android:text="@string/manage_synced_calendars"/> + android:text="@string/manage_synced_calendars" /> @@ -372,19 +371,19 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="@dimen/bigger_margin" - android:layout_marginTop="@dimen/activity_margin" + android:layout_marginTop="@dimen/section_margin" android:text="@string/new_events" android:textAllCaps="true" - android:textSize="@dimen/smaller_text_size"/> + android:textSize="@dimen/smaller_text_size" /> + android:paddingStart="@dimen/medium_margin" + android:paddingEnd="@dimen/medium_margin" + android:text="@string/default_start_time" /> + tools:text="@string/next_full_hour" /> @@ -414,9 +413,9 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="?attr/selectableItemBackground" - android:paddingLeft="@dimen/normal_margin" + android:paddingStart="@dimen/normal_margin" android:paddingTop="@dimen/bigger_margin" - android:paddingRight="@dimen/normal_margin" + android:paddingEnd="@dimen/normal_margin" android:paddingBottom="@dimen/bigger_margin"> + android:paddingStart="@dimen/medium_margin" + android:paddingEnd="@dimen/medium_margin" + android:text="@string/default_duration" /> + tools:text="0 minutes" /> @@ -446,9 +445,9 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="?attr/selectableItemBackground" - android:paddingLeft="@dimen/normal_margin" + android:paddingStart="@dimen/normal_margin" android:paddingTop="@dimen/bigger_margin" - android:paddingRight="@dimen/normal_margin" + android:paddingEnd="@dimen/normal_margin" android:paddingBottom="@dimen/bigger_margin"> + android:paddingStart="@dimen/medium_margin" + android:paddingEnd="@dimen/medium_margin" + android:text="@string/default_event_type" /> + tools:text="@string/last_used_one" /> @@ -491,7 +490,7 @@ android:background="@null" android:clickable="false" android:paddingStart="@dimen/medium_margin" - android:text="@string/use_last_event_reminders"/> + android:text="@string/use_last_event_reminders" /> @@ -514,7 +513,7 @@ android:layout_toStartOf="@+id/settings_default_reminder_1" android:paddingStart="@dimen/medium_margin" android:paddingEnd="@dimen/medium_margin" - android:text="@string/default_reminder_1"/> + android:text="@string/default_reminder_1" /> + android:clickable="false" /> @@ -546,7 +545,7 @@ android:layout_toStartOf="@+id/settings_default_reminder_2" android:paddingStart="@dimen/medium_margin" android:paddingEnd="@dimen/medium_margin" - android:text="@string/default_reminder_2"/> + android:text="@string/default_reminder_2" /> + android:clickable="false" /> @@ -578,7 +577,7 @@ android:layout_toStartOf="@+id/settings_default_reminder_3" android:paddingStart="@dimen/medium_margin" android:paddingEnd="@dimen/medium_margin" - android:text="@string/default_reminder_3"/> + android:text="@string/default_reminder_3" /> + android:clickable="false" /> @@ -596,10 +595,10 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="@dimen/bigger_margin" - android:layout_marginTop="@dimen/activity_margin" + android:layout_marginTop="@dimen/section_margin" android:text="@string/weekly_view" android:textAllCaps="true" - android:textSize="@dimen/smaller_text_size"/> + android:textSize="@dimen/smaller_text_size" /> + android:text="@string/start_day_at" /> + android:clickable="false" /> @@ -638,10 +637,10 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="@dimen/bigger_margin" - android:layout_marginTop="@dimen/activity_margin" + android:layout_marginTop="@dimen/section_margin" android:text="@string/monthly_view" android:textAllCaps="true" - android:textSize="@dimen/smaller_text_size"/> + android:textSize="@dimen/smaller_text_size" /> + android:text="@string/week_numbers" /> @@ -682,7 +681,7 @@ android:background="@null" android:clickable="false" android:paddingStart="@dimen/medium_margin" - android:text="@string/show_a_grid"/> + android:text="@string/show_a_grid" /> @@ -691,10 +690,10 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="@dimen/bigger_margin" - android:layout_marginTop="@dimen/activity_margin" + android:layout_marginTop="@dimen/section_margin" android:text="@string/event_lists" android:textAllCaps="true" - android:textSize="@dimen/smaller_text_size"/> + android:textSize="@dimen/smaller_text_size" /> + android:text="@string/replace_description_with_location" /> @@ -736,7 +735,7 @@ android:layout_toStartOf="@+id/settings_display_past_events" android:paddingStart="@dimen/medium_margin" android:paddingEnd="@dimen/medium_margin" - android:text="@string/display_past_events"/> + android:text="@string/display_past_events" /> + android:clickable="false" /> @@ -754,10 +753,10 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="@dimen/bigger_margin" - android:layout_marginTop="@dimen/activity_margin" + android:layout_marginTop="@dimen/section_margin" android:text="@string/widgets" android:textAllCaps="true" - android:textSize="@dimen/smaller_text_size"/> + android:textSize="@dimen/smaller_text_size" /> + android:text="@string/font_size" /> + android:clickable="false" /> @@ -808,7 +807,7 @@ android:layout_toStartOf="@+id/settings_list_widget_view_to_open" android:paddingStart="@dimen/medium_margin" android:paddingEnd="@dimen/medium_margin" - android:text="@string/view_to_open_from_widget"/> + android:text="@string/view_to_open_from_widget" /> + android:clickable="false" /> @@ -837,7 +836,7 @@ android:layout_height="wrap_content" android:layout_centerVertical="true" android:paddingStart="@dimen/medium_margin" - android:text="@string/customize_widget_colors"/> + android:text="@string/customize_widget_colors" /> @@ -846,10 +845,10 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="@dimen/bigger_margin" - android:layout_marginTop="@dimen/activity_margin" + android:layout_marginTop="@dimen/section_margin" android:text="@string/events" android:textAllCaps="true" - android:textSize="@dimen/smaller_text_size"/> + android:textSize="@dimen/smaller_text_size" /> + android:text="@string/dim_past_events" /> @@ -890,7 +889,7 @@ android:background="@null" android:clickable="false" android:paddingStart="@dimen/medium_margin" - android:text="@string/allow_changing_time_zones"/> + android:text="@string/allow_changing_time_zones" /> @@ -911,7 +910,7 @@ android:layout_centerVertical="true" android:paddingStart="@dimen/medium_margin" android:paddingEnd="@dimen/medium_margin" - android:text="@string/delete_all_events"/> + android:text="@string/delete_all_events" /> @@ -920,10 +919,10 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="@dimen/bigger_margin" - android:layout_marginTop="@dimen/activity_margin" + android:layout_marginTop="@dimen/section_margin" android:text="@string/migrating" android:textAllCaps="true" - android:textSize="@dimen/smaller_text_size"/> + android:textSize="@dimen/smaller_text_size" /> + android:text="@string/export_settings" /> @@ -952,9 +951,9 @@ android:layout_height="wrap_content" android:layout_marginTop="@dimen/medium_margin" android:background="?attr/selectableItemBackground" - android:paddingLeft="@dimen/normal_margin" + android:paddingStart="@dimen/normal_margin" android:paddingTop="@dimen/activity_margin" - android:paddingRight="@dimen/normal_margin" + android:paddingEnd="@dimen/normal_margin" android:paddingBottom="@dimen/activity_margin"> + android:text="@string/import_settings" /> diff --git a/app/src/main/res/layout/event_list_widget.xml b/app/src/main/res/layout/event_list_widget.xml deleted file mode 100644 index 71387a632..000000000 --- a/app/src/main/res/layout/event_list_widget.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - diff --git a/app/src/main/res/layout/fragment_month_widget.xml b/app/src/main/res/layout/fragment_month_widget.xml index 1ba838d01..91fd1a898 100644 --- a/app/src/main/res/layout/fragment_month_widget.xml +++ b/app/src/main/res/layout/fragment_month_widget.xml @@ -1,12 +1,21 @@ - + + + android:src="@drawable/ic_chevron_left_vector" /> + tools:text="January" /> + android:src="@drawable/ic_today_vector" /> + android:src="@drawable/ic_chevron_right_vector" /> + android:src="@drawable/ic_plus_vector" /> + tools:ignore="UnknownIdInLayout" /> + android:visibility="gone" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:visibility="gone" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:visibility="gone" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:visibility="gone" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:visibility="gone" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:visibility="gone" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> diff --git a/app/src/main/res/layout/fragment_month_widget_config.xml b/app/src/main/res/layout/fragment_month_widget_config.xml index a7c627fdb..a52b5393d 100644 --- a/app/src/main/res/layout/fragment_month_widget_config.xml +++ b/app/src/main/res/layout/fragment_month_widget_config.xml @@ -1,13 +1,13 @@ - - + + tools:ignore="UnknownIdInLayout" /> + android:visibility="gone" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:visibility="gone" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:visibility="gone" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:visibility="gone" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:visibility="gone" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:visibility="gone" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> + android:orientation="vertical" /> diff --git a/app/src/main/res/layout/widget_config_date.xml b/app/src/main/res/layout/widget_config_date.xml new file mode 100644 index 000000000..86b782e96 --- /dev/null +++ b/app/src/main/res/layout/widget_config_date.xml @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + +