From 1898c1f71a04d75801dce2d45b4d1698946f4680 Mon Sep 17 00:00:00 2001 From: 10cents Date: Mon, 30 Apr 2018 13:20:05 +0200 Subject: [PATCH 01/64] FAQ --- app/src/main/res/values-da/strings.xml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/app/src/main/res/values-da/strings.xml b/app/src/main/res/values-da/strings.xml index 423256d47..373fa0899 100644 --- a/app/src/main/res/values-da/strings.xml +++ b/app/src/main/res/values-da/strings.xml @@ -186,12 +186,11 @@ Kaffetid! - How can I remove the holidays imported via the \"Add holidays\" button? - Holidays created that way are inserted in a new event type called \"Holidays\". You can go in Settings -> Manage Event Types, - long press the given event type and delete it by selecting the trashbin. - Can I sync my events via Google Calendar, or other service supporting CalDAV? - Yes, just toggle \"CalDAV sync\" in the app settings and select the calendars you want to sync. However, you will need some third party app handling the synchronization between the device and servers. - In case you want to synchronize a Google calendar, their official Calendar app will do the job. For other calendars you will need a third party sync adapter, for example DAVdroid. + Hvordan kan jeg fjerne helligdage der er importeret med funktionen \"Tilføj helligdage\"? + Helligdage oprettet på den måde er indsat under begivenhedstypen \"Helligdage\". Gå til Indstillinger -> Håndter begivenhedstyper. Efter et par sekunders pres på en type kan du slette den ved at klikke på papirkurven. + Kan jeg synkronisere mine begivenheder med Googles kalender elleer en anden kalender der understøtter CalDAV? + Ja, klik på \"CalDAV sync\" i appens indstillinger og vælg de kalendere du vil synkronisere. Det kræver dog at du har en app til at synkronisere mellem din enhed og kalenderservere. + Hvis du vil synkronisere en Googlekalender, kan deres officielle app klare det. For andre kalenderes vedkommende kan du bruge en 3. partsapp som for eksempel DAVdroid. From 60747821f1df278b0cde390aa0eec47f60005596 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 1 May 2018 19:36:11 +0200 Subject: [PATCH 02/64] try getting a reference to the db before doing any operations on it --- .../calendar/receivers/BootCompletedReceiver.kt | 4 ++++ build.gradle | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/receivers/BootCompletedReceiver.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/receivers/BootCompletedReceiver.kt index d6aec0c36..5c1c4144f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/receivers/BootCompletedReceiver.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/receivers/BootCompletedReceiver.kt @@ -3,6 +3,7 @@ package com.simplemobiletools.calendar.receivers import android.content.BroadcastReceiver import android.content.Context import android.content.Intent +import com.simplemobiletools.calendar.extensions.dbHelper import com.simplemobiletools.calendar.extensions.notifyRunningEvents import com.simplemobiletools.calendar.extensions.recheckCalDAVCalendars import com.simplemobiletools.calendar.extensions.scheduleAllEvents @@ -10,6 +11,9 @@ import com.simplemobiletools.calendar.extensions.scheduleAllEvents class BootCompletedReceiver : BroadcastReceiver() { override fun onReceive(context: Context, intent: Intent) { + // try just getting a reference to the db so it updates in time + context.dbHelper + Thread { context.apply { scheduleAllEvents() diff --git a/build.gradle b/build.gradle index e6abf43e1..11d7524b9 100644 --- a/build.gradle +++ b/build.gradle @@ -9,7 +9,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:3.1.0' + classpath 'com.android.tools.build:gradle:3.1.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong From 52b9e1399056bef35b2df7bc2a28a463ff272b84 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 1 May 2018 19:43:09 +0200 Subject: [PATCH 03/64] update commons to 3.21.2 --- app/build.gradle | 2 +- .../calendar/activities/MainActivity.kt | 2 +- .../calendar/activities/SimpleActivity.kt | 9 ++++++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 02719d1fe..d8398b85d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -46,7 +46,7 @@ ext { } dependencies { - implementation 'com.simplemobiletools:commons:3.18.23' + implementation 'com.simplemobiletools:commons:3.21.2' implementation 'joda-time:joda-time:2.9.9' implementation 'com.facebook.stetho:stetho:1.5.0' implementation 'com.android.support:multidex:1.0.3' diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/MainActivity.kt index 3617d07d5..483b14045 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/MainActivity.kt @@ -67,7 +67,7 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) - appLaunched() + appLaunched(BuildConfig.APPLICATION_ID) // just get a reference to the database to make sure it is created properly dbHelper diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/SimpleActivity.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/SimpleActivity.kt index ab24d64f6..6e54ea0e5 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/SimpleActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/SimpleActivity.kt @@ -1,5 +1,12 @@ package com.simplemobiletools.calendar.activities +import com.simplemobiletools.calendar.R import com.simplemobiletools.commons.activities.BaseSimpleActivity -open class SimpleActivity : BaseSimpleActivity() +open class SimpleActivity : BaseSimpleActivity() { + override fun getAppIconIDs() = arrayListOf( + R.mipmap.ic_launcher + ) + + override fun getAppLauncherName() = getString(R.string.app_launcher_name) +} From 898519de91c962397904eb614d8718247f1f81cc Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 1 May 2018 20:37:39 +0200 Subject: [PATCH 04/64] update commons to 3.21.3 --- app/build.gradle | 2 +- .../calendar/activities/EventActivity.kt | 2 +- .../activities/WidgetListConfigureActivity.kt | 12 ++++++++---- .../activities/WidgetMonthlyConfigureActivity.kt | 15 ++++++++++----- .../calendar/adapters/FilterEventTypeAdapter.kt | 4 ++-- .../calendar/adapters/ManageEventTypesAdapter.kt | 4 ++-- .../calendar/dialogs/ImportEventsDialog.kt | 4 ++-- .../calendar/dialogs/SelectEventCalendarDialog.kt | 4 ++-- .../dialogs/SelectEventTypeColorDialog.kt | 4 ++-- .../calendar/dialogs/SelectEventTypeDialog.kt | 4 ++-- .../calendar/dialogs/UpdateEventTypeDialog.kt | 8 +++++--- 11 files changed, 37 insertions(+), 26 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index d8398b85d..4321fd652 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -46,7 +46,7 @@ ext { } dependencies { - implementation 'com.simplemobiletools:commons:3.21.2' + implementation 'com.simplemobiletools:commons:3.21.3' implementation 'joda-time:joda-time:2.9.9' implementation 'com.facebook.stetho:stetho:1.5.0' implementation 'com.android.support:multidex:1.0.3' diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/EventActivity.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/EventActivity.kt index 7a3e6feeb..30f0e4b73 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/EventActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/EventActivity.kt @@ -421,7 +421,7 @@ class EventActivity : SimpleActivity() { val eventType = dbHelper.getEventType(mEventTypeId) if (eventType != null) { event_type.text = eventType.title - event_type_color.setBackgroundWithStroke(eventType.color, config.backgroundColor) + event_type_color.setFillWithStroke(eventType.color, config.backgroundColor) } } diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/WidgetListConfigureActivity.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/WidgetListConfigureActivity.kt index 90727f041..301e9f42c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/WidgetListConfigureActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/WidgetListConfigureActivity.kt @@ -107,15 +107,19 @@ class WidgetListConfigureActivity : SimpleActivity() { private fun pickBackgroundColor() { ColorPickerDialog(this, mBgColorWithoutTransparency) { wasPositivePressed, color -> - mBgColorWithoutTransparency = color - updateBgColor() + if (wasPositivePressed) { + mBgColorWithoutTransparency = color + updateBgColor() + } } } private fun pickTextColor() { ColorPickerDialog(this, mTextColor) { wasPositivePressed, color -> - mTextColorWithoutTransparency = color - updateColors() + if (wasPositivePressed) { + mTextColorWithoutTransparency = color + updateColors() + } } } diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/WidgetMonthlyConfigureActivity.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/WidgetMonthlyConfigureActivity.kt index c391626b7..d40910807 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/WidgetMonthlyConfigureActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/WidgetMonthlyConfigureActivity.kt @@ -23,6 +23,7 @@ import com.simplemobiletools.commons.dialogs.ColorPickerDialog import com.simplemobiletools.commons.extensions.adjustAlpha import com.simplemobiletools.commons.extensions.applyColorFilter import com.simplemobiletools.commons.extensions.beVisible +import com.simplemobiletools.commons.extensions.setFillWithStroke import kotlinx.android.synthetic.main.first_row.* import kotlinx.android.synthetic.main.top_navigation.* import kotlinx.android.synthetic.main.widget_config_monthly.* @@ -111,16 +112,20 @@ class WidgetMonthlyConfigureActivity : SimpleActivity(), MonthlyCalendar { private fun pickBackgroundColor() { ColorPickerDialog(this, mBgColorWithoutTransparency) { wasPositivePressed, color -> - mBgColorWithoutTransparency = color - updateBgColor() + if (wasPositivePressed) { + mBgColorWithoutTransparency = color + updateBgColor() + } } } private fun pickTextColor() { ColorPickerDialog(this, mTextColor) { wasPositivePressed, color -> - mTextColorWithoutTransparency = color - updateColors() - updateDays() + if (wasPositivePressed) { + mTextColorWithoutTransparency = color + updateColors() + updateDays() + } } } diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/adapters/FilterEventTypeAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/adapters/FilterEventTypeAdapter.kt index 2ce0e947b..30f9006ff 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/adapters/FilterEventTypeAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/adapters/FilterEventTypeAdapter.kt @@ -9,7 +9,7 @@ import com.simplemobiletools.calendar.activities.SimpleActivity import com.simplemobiletools.calendar.extensions.config import com.simplemobiletools.calendar.models.EventType import com.simplemobiletools.commons.extensions.getAdjustedPrimaryColor -import com.simplemobiletools.commons.extensions.setBackgroundWithStroke +import com.simplemobiletools.commons.extensions.setFillWithStroke import com.simplemobiletools.commons.interfaces.MyAdapterListener import kotlinx.android.synthetic.main.filter_event_type_view.view.* import java.util.* @@ -73,7 +73,7 @@ class FilterEventTypeAdapter(val activity: SimpleActivity, val eventTypes: List< itemView.apply { filter_event_type_checkbox.setColors(activity.config.textColor, activity.getAdjustedPrimaryColor(), activity.config.backgroundColor) filter_event_type_checkbox.text = eventType.getDisplayTitle() - filter_event_type_color.setBackgroundWithStroke(eventType.color, activity.config.backgroundColor) + filter_event_type_color.setFillWithStroke(eventType.color, activity.config.backgroundColor) filter_event_type_holder.setOnClickListener { viewClicked(!filter_event_type_checkbox.isChecked) } } diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/adapters/ManageEventTypesAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/adapters/ManageEventTypesAdapter.kt index 2f28d967d..97553d605 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/adapters/ManageEventTypesAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/adapters/ManageEventTypesAdapter.kt @@ -13,7 +13,7 @@ import com.simplemobiletools.calendar.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.setBackgroundWithStroke +import com.simplemobiletools.commons.extensions.setFillWithStroke import com.simplemobiletools.commons.extensions.toast import com.simplemobiletools.commons.models.RadioItem import com.simplemobiletools.commons.views.MyRecyclerView @@ -60,7 +60,7 @@ class ManageEventTypesAdapter(activity: SimpleActivity, val eventTypes: ArrayLis private fun setupView(view: View, eventType: EventType) { view.apply { event_type_title.text = eventType.getDisplayTitle() - event_type_color.setBackgroundWithStroke(eventType.color, activity.config.backgroundColor) + event_type_color.setFillWithStroke(eventType.color, activity.config.backgroundColor) event_type_title.setTextColor(textColor) } } diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/dialogs/ImportEventsDialog.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/dialogs/ImportEventsDialog.kt index d7ef3f293..568a5dc94 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/dialogs/ImportEventsDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/dialogs/ImportEventsDialog.kt @@ -9,7 +9,7 @@ import com.simplemobiletools.calendar.extensions.dbHelper import com.simplemobiletools.calendar.helpers.DBHelper import com.simplemobiletools.calendar.helpers.IcsImporter import com.simplemobiletools.calendar.helpers.IcsImporter.ImportResult.* -import com.simplemobiletools.commons.extensions.setBackgroundWithStroke +import com.simplemobiletools.commons.extensions.setFillWithStroke import com.simplemobiletools.commons.extensions.setupDialogStuff import com.simplemobiletools.commons.extensions.toast import kotlinx.android.synthetic.main.dialog_import_events.view.* @@ -50,7 +50,7 @@ class ImportEventsDialog(val activity: SimpleActivity, val path: String, val cal private fun updateEventType(view: ViewGroup) { val eventType = activity.dbHelper.getEventType(currEventTypeId) view.import_event_type_title.text = eventType!!.getDisplayTitle() - view.import_event_type_color.setBackgroundWithStroke(eventType.color, activity.config.backgroundColor) + view.import_event_type_color.setFillWithStroke(eventType.color, activity.config.backgroundColor) } private fun handleParseResult(result: IcsImporter.ImportResult) { diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/dialogs/SelectEventCalendarDialog.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/dialogs/SelectEventCalendarDialog.kt index b442a5dda..c8d175f49 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/dialogs/SelectEventCalendarDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/dialogs/SelectEventCalendarDialog.kt @@ -11,7 +11,7 @@ import com.simplemobiletools.calendar.extensions.config import com.simplemobiletools.calendar.extensions.dbHelper import com.simplemobiletools.calendar.helpers.STORED_LOCALLY_ONLY import com.simplemobiletools.calendar.models.CalDAVCalendar -import com.simplemobiletools.commons.extensions.setBackgroundWithStroke +import com.simplemobiletools.commons.extensions.setFillWithStroke import com.simplemobiletools.commons.extensions.setupDialogStuff import com.simplemobiletools.commons.extensions.updateTextColors import kotlinx.android.synthetic.main.dialog_select_radio_group.view.* @@ -52,7 +52,7 @@ class SelectEventCalendarDialog(val activity: Activity, val calendars: List - eventType!!.color = color - setupColor(type_color) + if (wasPositivePressed) { + eventType!!.color = color + setupColor(type_color) + } } } else { SelectEventTypeColorDialog(activity, eventType!!) { @@ -79,6 +81,6 @@ class UpdateEventTypeDialog(val activity: Activity, var eventType: EventType? = } private fun setupColor(view: ImageView) { - view.setBackgroundWithStroke(eventType!!.color, activity.config.backgroundColor) + view.setFillWithStroke(eventType!!.color, activity.config.backgroundColor) } } From 48d452bd28e2c7509ec40c46f0cf0146cc536af1 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 1 May 2018 20:44:09 +0200 Subject: [PATCH 05/64] add a white stroke around color pickers on widget config screens --- .../calendar/activities/WidgetListConfigureActivity.kt | 5 +++-- .../calendar/activities/WidgetMonthlyConfigureActivity.kt | 4 ++-- app/src/main/res/layout/widget_config_list.xml | 4 ++-- app/src/main/res/layout/widget_config_monthly.xml | 4 ++-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/WidgetListConfigureActivity.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/WidgetListConfigureActivity.kt index 301e9f42c..a31c174cf 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/WidgetListConfigureActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/WidgetListConfigureActivity.kt @@ -18,6 +18,7 @@ import com.simplemobiletools.calendar.models.ListItem import com.simplemobiletools.calendar.models.ListSection import com.simplemobiletools.commons.dialogs.ColorPickerDialog import com.simplemobiletools.commons.extensions.adjustAlpha +import com.simplemobiletools.commons.extensions.setFillWithStroke import kotlinx.android.synthetic.main.widget_config_list.* import org.joda.time.DateTime import java.util.* @@ -133,14 +134,14 @@ class WidgetListConfigureActivity : SimpleActivity() { private fun updateColors() { mTextColor = mTextColorWithoutTransparency mEventsAdapter?.updateTextColor(mTextColor) - config_text_color.setBackgroundColor(mTextColor) + config_text_color.setFillWithStroke(mTextColor, Color.BLACK) config_save.setTextColor(mTextColor) } private fun updateBgColor() { mBgColor = mBgColorWithoutTransparency.adjustAlpha(mBgAlpha) config_events_list.setBackgroundColor(mBgColor) - config_bg_color.setBackgroundColor(mBgColor) + config_bg_color.setFillWithStroke(mBgColor, Color.BLACK) config_save.setBackgroundColor(mBgColor) } diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/WidgetMonthlyConfigureActivity.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/WidgetMonthlyConfigureActivity.kt index d40910807..0c3cd60a6 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/WidgetMonthlyConfigureActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/WidgetMonthlyConfigureActivity.kt @@ -144,7 +144,7 @@ class WidgetMonthlyConfigureActivity : SimpleActivity(), MonthlyCalendar { top_left_arrow.applyColorFilter(mTextColor) top_right_arrow.applyColorFilter(mTextColor) top_value.setTextColor(mTextColor) - config_text_color.setBackgroundColor(mTextColor) + config_text_color.setFillWithStroke(mTextColor, Color.BLACK) config_save.setTextColor(mTextColor) updateLabels() } @@ -152,7 +152,7 @@ class WidgetMonthlyConfigureActivity : SimpleActivity(), MonthlyCalendar { private fun updateBgColor() { mBgColor = mBgColorWithoutTransparency.adjustAlpha(mBgAlpha) config_calendar.setBackgroundColor(mBgColor) - config_bg_color.setBackgroundColor(mBgColor) + config_bg_color.setFillWithStroke(mBgColor, Color.BLACK) config_save.setBackgroundColor(mBgColor) } diff --git a/app/src/main/res/layout/widget_config_list.xml b/app/src/main/res/layout/widget_config_list.xml index 34392e47b..0f9d6ca60 100644 --- a/app/src/main/res/layout/widget_config_list.xml +++ b/app/src/main/res/layout/widget_config_list.xml @@ -20,7 +20,7 @@ android:paddingTop="@dimen/medium_margin" app:layoutManager="com.simplemobiletools.commons.views.MyLinearLayoutManager"/> -