updating target SDK to 29

This commit is contained in:
tibbi 2020-02-06 22:29:58 +01:00
parent 89ddffa3f2
commit 248faf874a
8 changed files with 23 additions and 20 deletions

View File

@ -11,13 +11,13 @@ if (keystorePropertiesFile.exists()) {
} }
android { android {
compileSdkVersion 28 compileSdkVersion 29
buildToolsVersion "28.0.3" buildToolsVersion "29.0.2"
defaultConfig { defaultConfig {
applicationId "com.simplemobiletools.calendar.pro" applicationId "com.simplemobiletools.calendar.pro"
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 28 targetSdkVersion 29
versionCode 170 versionCode 170
versionName "6.8.3" versionName "6.8.3"
multiDexEnabled true multiDexEnabled true

View File

@ -25,6 +25,7 @@
android:allowBackup="true" android:allowBackup="true"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
android:label="@string/app_launcher_name" android:label="@string/app_launcher_name"
android:requestLegacyExternalStorage="true"
android:roundIcon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher"
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/AppTheme"> android:theme="@style/AppTheme">

View File

@ -360,8 +360,8 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
private fun checkIsViewIntent() { private fun checkIsViewIntent() {
if (intent?.action == Intent.ACTION_VIEW && intent.data != null) { if (intent?.action == Intent.ACTION_VIEW && intent.data != null) {
val uri = intent.data val uri = intent.data
if (uri.authority == "com.android.calendar") { if (uri?.authority?.equals("com.android.calendar") == true) {
if (uri.path.startsWith("/events")) { if (uri.path!!.startsWith("/events")) {
ensureBackgroundThread { ensureBackgroundThread {
// intents like content://com.android.calendar/events/1756 // intents like content://com.android.calendar/events/1756
val eventId = uri.lastPathSegment val eventId = uri.lastPathSegment
@ -384,7 +384,7 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
} }
} }
} else { } else {
tryImportEventsFromFile(uri) tryImportEventsFromFile(uri!!)
} }
} }
} }
@ -753,7 +753,7 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
private fun tryImportEventsFromFile(uri: Uri) { private fun tryImportEventsFromFile(uri: Uri) {
when { when {
uri.scheme == "file" -> showImportEventsDialog(uri.path) uri.scheme == "file" -> showImportEventsDialog(uri.path!!)
uri.scheme == "content" -> { uri.scheme == "content" -> {
val tempFile = getTempFile() val tempFile = getTempFile()
if (tempFile == null) { if (tempFile == null) {
@ -763,7 +763,7 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
val inputStream = contentResolver.openInputStream(uri) val inputStream = contentResolver.openInputStream(uri)
val out = FileOutputStream(tempFile) val out = FileOutputStream(tempFile)
inputStream.copyTo(out) inputStream!!.copyTo(out)
showImportEventsDialog(tempFile.absolutePath) showImportEventsDialog(tempFile.absolutePath)
} }
else -> toast(R.string.invalid_file_format) else -> toast(R.string.invalid_file_format)

View File

@ -37,7 +37,7 @@ class DayFragment : Fragment() {
val view = inflater.inflate(R.layout.fragment_day, container, false) val view = inflater.inflate(R.layout.fragment_day, container, false)
mHolder = view.day_holder mHolder = view.day_holder
mDayCode = arguments!!.getString(DAY_CODE) mDayCode = arguments!!.getString(DAY_CODE)!!
setupButtons() setupButtons()
return view return view
} }

View File

@ -43,7 +43,7 @@ class MonthFragment : Fragment(), MonthlyCalendar {
mRes = resources mRes = resources
mPackageName = activity!!.packageName mPackageName = activity!!.packageName
mHolder = view.month_calendar_holder mHolder = view.month_calendar_holder
mDayCode = arguments!!.getString(DAY_CODE) mDayCode = arguments!!.getString(DAY_CODE)!!
mConfig = context!!.config mConfig = context!!.config
storeStateVariables() storeStateVariables()

View File

@ -340,7 +340,7 @@ class CalDAVHelper(val context: Context) {
val newUri = context.contentResolver.insert(uri, values) val newUri = context.contentResolver.insert(uri, values)
val calendarId = event.getCalDAVCalendarId() val calendarId = event.getCalDAVCalendarId()
val eventRemoteID = java.lang.Long.parseLong(newUri.lastPathSegment) val eventRemoteID = java.lang.Long.parseLong(newUri!!.lastPathSegment!!)
event.importId = getCalDAVEventImportId(calendarId, eventRemoteID) event.importId = getCalDAVEventImportId(calendarId, eventRemoteID)
setupCalDAVEventReminders(event) setupCalDAVEventReminders(event)

View File

@ -33,15 +33,15 @@ class Config(context: Context) : BaseConfig(context) {
set(vibrate) = prefs.edit().putBoolean(VIBRATE, vibrate).apply() set(vibrate) = prefs.edit().putBoolean(VIBRATE, vibrate).apply()
var reminderSoundUri: String var reminderSoundUri: String
get() = prefs.getString(REMINDER_SOUND_URI, context.getDefaultAlarmUri(ALARM_SOUND_TYPE_NOTIFICATION).toString()) get() = prefs.getString(REMINDER_SOUND_URI, context.getDefaultAlarmUri(ALARM_SOUND_TYPE_NOTIFICATION).toString())!!
set(reminderSoundUri) = prefs.edit().putString(REMINDER_SOUND_URI, reminderSoundUri).apply() set(reminderSoundUri) = prefs.edit().putString(REMINDER_SOUND_URI, reminderSoundUri).apply()
var reminderSoundTitle: String var reminderSoundTitle: String
get() = prefs.getString(REMINDER_SOUND_TITLE, context.getDefaultAlarmTitle(ALARM_SOUND_TYPE_NOTIFICATION)) get() = prefs.getString(REMINDER_SOUND_TITLE, context.getDefaultAlarmTitle(ALARM_SOUND_TYPE_NOTIFICATION))!!
set(reminderSoundTitle) = prefs.edit().putString(REMINDER_SOUND_TITLE, reminderSoundTitle).apply() set(reminderSoundTitle) = prefs.edit().putString(REMINDER_SOUND_TITLE, reminderSoundTitle).apply()
var lastSoundUri: String var lastSoundUri: String
get() = prefs.getString(LAST_SOUND_URI, "") get() = prefs.getString(LAST_SOUND_URI, "")!!
set(lastSoundUri) = prefs.edit().putString(LAST_SOUND_URI, lastSoundUri).apply() set(lastSoundUri) = prefs.edit().putString(LAST_SOUND_URI, lastSoundUri).apply()
var lastReminderChannel: Long var lastReminderChannel: Long
@ -69,7 +69,7 @@ class Config(context: Context) : BaseConfig(context) {
set(displayPastEvents) = prefs.edit().putInt(DISPLAY_PAST_EVENTS, displayPastEvents).apply() set(displayPastEvents) = prefs.edit().putInt(DISPLAY_PAST_EVENTS, displayPastEvents).apply()
var displayEventTypes: Set<String> var displayEventTypes: Set<String>
get() = prefs.getStringSet(DISPLAY_EVENT_TYPES, HashSet<String>()) get() = prefs.getStringSet(DISPLAY_EVENT_TYPES, HashSet<String>())!!
set(displayEventTypes) = prefs.edit().remove(DISPLAY_EVENT_TYPES).putStringSet(DISPLAY_EVENT_TYPES, displayEventTypes).apply() set(displayEventTypes) = prefs.edit().remove(DISPLAY_EVENT_TYPES).putStringSet(DISPLAY_EVENT_TYPES, displayEventTypes).apply()
var listWidgetViewToOpen: Int var listWidgetViewToOpen: Int
@ -84,7 +84,7 @@ class Config(context: Context) : BaseConfig(context) {
} }
var caldavSyncedCalendarIds: String var caldavSyncedCalendarIds: String
get() = prefs.getString(CALDAV_SYNCED_CALENDAR_IDS, "") get() = prefs.getString(CALDAV_SYNCED_CALENDAR_IDS, "")!!
set(calendarIDs) = prefs.edit().putString(CALDAV_SYNCED_CALENDAR_IDS, calendarIDs).apply() set(calendarIDs) = prefs.edit().putString(CALDAV_SYNCED_CALENDAR_IDS, calendarIDs).apply()
var lastUsedCaldavCalendarId: Int var lastUsedCaldavCalendarId: Int

View File

@ -8,9 +8,11 @@ import com.simplemobiletools.calendar.pro.extensions.rescheduleReminder
import com.simplemobiletools.calendar.pro.helpers.EVENT_ID import com.simplemobiletools.calendar.pro.helpers.EVENT_ID
class SnoozeService : IntentService("Snooze") { class SnoozeService : IntentService("Snooze") {
override fun onHandleIntent(intent: Intent) { override fun onHandleIntent(intent: Intent?) {
if (intent != null) {
val eventId = intent.getLongExtra(EVENT_ID, 0L) val eventId = intent.getLongExtra(EVENT_ID, 0L)
val event = eventsDB.getEventWithId(eventId) val event = eventsDB.getEventWithId(eventId)
rescheduleReminder(event, config.snoozeTime) rescheduleReminder(event, config.snoozeTime)
} }
} }
}