mirror of
https://github.com/etesync/android
synced 2025-07-03 13:22:37 +00:00
Fix build following changes.
This commit is contained in:
parent
b7c2f8841f
commit
79675261d2
@ -424,7 +424,7 @@ class LocalAddressBook(
|
|||||||
val values = ContentValues(1)
|
val values = ContentValues(1)
|
||||||
values.put(Groups.TITLE, title)
|
values.put(Groups.TITLE, title)
|
||||||
val uri = provider.insert(syncAdapterURI(Groups.CONTENT_URI), values)
|
val uri = provider.insert(syncAdapterURI(Groups.CONTENT_URI), values)
|
||||||
return ContentUris.parseId(uri)
|
return ContentUris.parseId(uri!!)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun removeEmptyGroups() {
|
fun removeEmptyGroups() {
|
||||||
|
@ -10,7 +10,6 @@ package com.etesync.syncadapter.resource
|
|||||||
|
|
||||||
import android.accounts.Account
|
import android.accounts.Account
|
||||||
import android.content.ContentProviderClient
|
import android.content.ContentProviderClient
|
||||||
import android.content.ContentProviderOperation
|
|
||||||
import android.content.ContentUris
|
import android.content.ContentUris
|
||||||
import android.content.ContentValues
|
import android.content.ContentValues
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
@ -24,7 +23,6 @@ import com.etesync.syncadapter.log.Logger
|
|||||||
import com.etesync.syncadapter.model.JournalEntity
|
import com.etesync.syncadapter.model.JournalEntity
|
||||||
import com.etesync.syncadapter.resource.LocalEvent.Companion.COLUMN_UID
|
import com.etesync.syncadapter.resource.LocalEvent.Companion.COLUMN_UID
|
||||||
import org.apache.commons.lang3.StringUtils
|
import org.apache.commons.lang3.StringUtils
|
||||||
import org.dmfs.tasks.contract.TaskContract
|
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import java.util.logging.Level
|
import java.util.logging.Level
|
||||||
|
|
||||||
@ -210,15 +208,15 @@ class LocalCalendar private constructor(
|
|||||||
cursor2!!.close()
|
cursor2!!.close()
|
||||||
val batch = BatchOperation(provider)
|
val batch = BatchOperation(provider)
|
||||||
// re-schedule original event and set it to DIRTY
|
// re-schedule original event and set it to DIRTY
|
||||||
batch.enqueue(BatchOperation.Operation(
|
batch.enqueue(
|
||||||
ContentProviderOperation.newUpdate(syncAdapterURI(ContentUris.withAppendedId(Events.CONTENT_URI, originalID)))
|
BatchOperation.CpoBuilder.newUpdate(syncAdapterURI(ContentUris.withAppendedId(Events.CONTENT_URI, originalID)))
|
||||||
.withValue(LocalEvent.COLUMN_SEQUENCE, originalSequence + 1)
|
.withValue(LocalEvent.COLUMN_SEQUENCE, originalSequence + 1)
|
||||||
.withValue(Events.DIRTY, 1)
|
.withValue(Events.DIRTY, 1)
|
||||||
))
|
)
|
||||||
// remove exception
|
// remove exception
|
||||||
batch.enqueue(BatchOperation.Operation(
|
batch.enqueue(
|
||||||
ContentProviderOperation.newDelete(syncAdapterURI(ContentUris.withAppendedId(Events.CONTENT_URI, id)))
|
BatchOperation.CpoBuilder.newDelete(syncAdapterURI(ContentUris.withAppendedId(Events.CONTENT_URI, id)))
|
||||||
))
|
)
|
||||||
batch.commit()
|
batch.commit()
|
||||||
}
|
}
|
||||||
cursor!!.close()
|
cursor!!.close()
|
||||||
@ -242,16 +240,14 @@ class LocalCalendar private constructor(
|
|||||||
|
|
||||||
val batch = BatchOperation(provider)
|
val batch = BatchOperation(provider)
|
||||||
// original event to DIRTY
|
// original event to DIRTY
|
||||||
batch.enqueue(BatchOperation.Operation(
|
batch.enqueue(BatchOperation.CpoBuilder.newUpdate(syncAdapterURI(ContentUris.withAppendedId(Events.CONTENT_URI, originalID)))
|
||||||
ContentProviderOperation.newUpdate(syncAdapterURI(ContentUris.withAppendedId(Events.CONTENT_URI, originalID)))
|
|
||||||
.withValue(Events.DIRTY, 1)
|
.withValue(Events.DIRTY, 1)
|
||||||
))
|
)
|
||||||
// increase SEQUENCE and set DIRTY to 0
|
// increase SEQUENCE and set DIRTY to 0
|
||||||
batch.enqueue(BatchOperation.Operation(
|
batch.enqueue(BatchOperation.CpoBuilder.newUpdate(syncAdapterURI(ContentUris.withAppendedId(Events.CONTENT_URI, id)))
|
||||||
ContentProviderOperation.newUpdate(syncAdapterURI(ContentUris.withAppendedId(Events.CONTENT_URI, id)))
|
|
||||||
.withValue(LocalEvent.COLUMN_SEQUENCE, sequence + 1)
|
.withValue(LocalEvent.COLUMN_SEQUENCE, sequence + 1)
|
||||||
.withValue(Events.DIRTY, 0)
|
.withValue(Events.DIRTY, 0)
|
||||||
))
|
)
|
||||||
batch.commit()
|
batch.commit()
|
||||||
}
|
}
|
||||||
cursor!!.close()
|
cursor!!.close()
|
||||||
|
@ -141,17 +141,15 @@ class LocalContact : AndroidContact, LocalAddress {
|
|||||||
super.insertDataRows(batch)
|
super.insertDataRows(batch)
|
||||||
|
|
||||||
if (contact?.unknownProperties != null) {
|
if (contact?.unknownProperties != null) {
|
||||||
val op: BatchOperation.Operation
|
var builder = BatchOperation.CpoBuilder.newInsert(dataSyncURI())
|
||||||
val builder = ContentProviderOperation.newInsert(dataSyncURI())
|
|
||||||
if (id == null) {
|
if (id == null) {
|
||||||
op = BatchOperation.Operation(builder, UnknownProperties.RAW_CONTACT_ID, 0)
|
builder = builder.withValue(UnknownProperties.RAW_CONTACT_ID, 0)
|
||||||
} else {
|
} else {
|
||||||
op = BatchOperation.Operation(builder)
|
builder = builder.withValue(UnknownProperties.RAW_CONTACT_ID, id)
|
||||||
builder.withValue(UnknownProperties.RAW_CONTACT_ID, id)
|
|
||||||
}
|
}
|
||||||
builder.withValue(UnknownProperties.MIMETYPE, UnknownProperties.CONTENT_ITEM_TYPE)
|
builder.withValue(UnknownProperties.MIMETYPE, UnknownProperties.CONTENT_ITEM_TYPE)
|
||||||
.withValue(UnknownProperties.UNKNOWN_PROPERTIES, contact?.unknownProperties)
|
.withValue(UnknownProperties.UNKNOWN_PROPERTIES, contact?.unknownProperties)
|
||||||
batch.enqueue(op)
|
batch.enqueue(builder)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -166,7 +164,7 @@ class LocalContact : AndroidContact, LocalAddress {
|
|||||||
return this.add()
|
return this.add()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun buildContact(builder: ContentProviderOperation.Builder, update: Boolean) {
|
override fun buildContact(builder: BatchOperation.CpoBuilder, update: Boolean) {
|
||||||
super.buildContact(builder, update)
|
super.buildContact(builder, update)
|
||||||
builder.withValue(ContactsContract.RawContacts.DIRTY, if (saveAsDirty) 1 else 0)
|
builder.withValue(ContactsContract.RawContacts.DIRTY, if (saveAsDirty) 1 else 0)
|
||||||
}
|
}
|
||||||
@ -202,10 +200,10 @@ class LocalContact : AndroidContact, LocalAddress {
|
|||||||
if (batch == null)
|
if (batch == null)
|
||||||
addressBook.provider!!.update(rawContactSyncURI(), values, null, null)
|
addressBook.provider!!.update(rawContactSyncURI(), values, null, null)
|
||||||
else {
|
else {
|
||||||
val builder = ContentProviderOperation
|
val builder = BatchOperation.CpoBuilder
|
||||||
.newUpdate(rawContactSyncURI())
|
.newUpdate(rawContactSyncURI())
|
||||||
.withValues(values)
|
.withValue(COLUMN_HASHCODE, hashCode)
|
||||||
batch.enqueue(BatchOperation.Operation(builder))
|
batch.enqueue(builder)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -223,33 +221,28 @@ class LocalContact : AndroidContact, LocalAddress {
|
|||||||
|
|
||||||
|
|
||||||
fun addToGroup(batch: BatchOperation, groupID: Long) {
|
fun addToGroup(batch: BatchOperation, groupID: Long) {
|
||||||
batch.enqueue(BatchOperation.Operation(
|
batch.enqueue(BatchOperation.CpoBuilder.newInsert(dataSyncURI())
|
||||||
ContentProviderOperation.newInsert(dataSyncURI())
|
|
||||||
.withValue(GroupMembership.MIMETYPE, GroupMembership.CONTENT_ITEM_TYPE)
|
.withValue(GroupMembership.MIMETYPE, GroupMembership.CONTENT_ITEM_TYPE)
|
||||||
.withValue(GroupMembership.RAW_CONTACT_ID, id)
|
.withValue(GroupMembership.RAW_CONTACT_ID, id)
|
||||||
.withValue(GroupMembership.GROUP_ROW_ID, groupID)
|
.withValue(GroupMembership.GROUP_ROW_ID, groupID)
|
||||||
))
|
)
|
||||||
groupMemberships.add(groupID)
|
groupMemberships.add(groupID)
|
||||||
|
|
||||||
batch.enqueue(BatchOperation.Operation(
|
batch.enqueue(BatchOperation.CpoBuilder.newInsert(dataSyncURI())
|
||||||
ContentProviderOperation.newInsert(dataSyncURI())
|
|
||||||
.withValue(CachedGroupMembership.MIMETYPE, CachedGroupMembership.CONTENT_ITEM_TYPE)
|
.withValue(CachedGroupMembership.MIMETYPE, CachedGroupMembership.CONTENT_ITEM_TYPE)
|
||||||
.withValue(CachedGroupMembership.RAW_CONTACT_ID, id)
|
.withValue(CachedGroupMembership.RAW_CONTACT_ID, id)
|
||||||
.withValue(CachedGroupMembership.GROUP_ID, groupID)
|
.withValue(CachedGroupMembership.GROUP_ID, groupID)
|
||||||
.withYieldAllowed(true)
|
)
|
||||||
))
|
|
||||||
cachedGroupMemberships.add(groupID)
|
cachedGroupMemberships.add(groupID)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun removeGroupMemberships(batch: BatchOperation) {
|
fun removeGroupMemberships(batch: BatchOperation) {
|
||||||
batch.enqueue(BatchOperation.Operation(
|
batch.enqueue(BatchOperation.CpoBuilder.newDelete(dataSyncURI())
|
||||||
ContentProviderOperation.newDelete(dataSyncURI())
|
|
||||||
.withSelection(
|
.withSelection(
|
||||||
Data.RAW_CONTACT_ID + "=? AND " + Data.MIMETYPE + " IN (?,?)",
|
Data.RAW_CONTACT_ID + "=? AND " + Data.MIMETYPE + " IN (?,?)",
|
||||||
arrayOf(id.toString(), GroupMembership.CONTENT_ITEM_TYPE, CachedGroupMembership.CONTENT_ITEM_TYPE)
|
arrayOf(id.toString(), GroupMembership.CONTENT_ITEM_TYPE, CachedGroupMembership.CONTENT_ITEM_TYPE)
|
||||||
)
|
)
|
||||||
.withYieldAllowed(true)
|
)
|
||||||
))
|
|
||||||
groupMemberships.clear()
|
groupMemberships.clear()
|
||||||
cachedGroupMemberships.clear()
|
cachedGroupMemberships.clear()
|
||||||
}
|
}
|
||||||
|
@ -83,7 +83,7 @@ class LocalEvent : AndroidEvent, LocalResource<Event> {
|
|||||||
weAreOrganizer = isOrganizer != null && isOrganizer != 0
|
weAreOrganizer = isOrganizer != null && isOrganizer != 0
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun buildEvent(recurrence: Event?, builder: ContentProviderOperation.Builder) {
|
override fun buildEvent(recurrence: Event?, builder: BatchOperation.CpoBuilder) {
|
||||||
super.buildEvent(recurrence, builder)
|
super.buildEvent(recurrence, builder)
|
||||||
|
|
||||||
val buildException = recurrence != null
|
val buildException = recurrence != null
|
||||||
@ -101,7 +101,7 @@ class LocalEvent : AndroidEvent, LocalResource<Event> {
|
|||||||
.withValue(COLUMN_ETAG, eTag)
|
.withValue(COLUMN_ETAG, eTag)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun insertReminder(batch: BatchOperation, idxEvent: Int, alarm: VAlarm) {
|
override fun insertReminder(batch: BatchOperation, idxEvent: Int?, alarm: VAlarm) {
|
||||||
// We only support DISPLAY and AUDIO alarms so modify when inserting
|
// We only support DISPLAY and AUDIO alarms so modify when inserting
|
||||||
val action = alarm.action
|
val action = alarm.action
|
||||||
val modifiedAlarm = when (action?.value) {
|
val modifiedAlarm = when (action?.value) {
|
||||||
@ -133,7 +133,7 @@ class LocalEvent : AndroidEvent, LocalResource<Event> {
|
|||||||
|
|
||||||
override fun legacyPrepareForUpload(fileName_: String?) {
|
override fun legacyPrepareForUpload(fileName_: String?) {
|
||||||
var uid: String? = null
|
var uid: String? = null
|
||||||
val c = calendar.provider.query(eventSyncURI(), arrayOf(COLUMN_UID), null, null, null)
|
val c = calendar.provider.query(eventSyncURI(), arrayOf(COLUMN_UID), null, null, null)!!
|
||||||
if (c.moveToNext())
|
if (c.moveToNext())
|
||||||
uid = c.getString(0)
|
uid = c.getString(0)
|
||||||
if (uid == null)
|
if (uid == null)
|
||||||
|
@ -135,23 +135,20 @@ class LocalGroup : AndroidGroup, LocalAddress {
|
|||||||
val batch = BatchOperation(addressBook.provider!!)
|
val batch = BatchOperation(addressBook.provider!!)
|
||||||
|
|
||||||
// delete cached group memberships
|
// delete cached group memberships
|
||||||
batch.enqueue(BatchOperation.Operation(
|
batch.enqueue(BatchOperation.CpoBuilder.newDelete(addressBook.syncAdapterURI(ContactsContract.Data.CONTENT_URI))
|
||||||
ContentProviderOperation.newDelete(addressBook.syncAdapterURI(ContactsContract.Data.CONTENT_URI))
|
|
||||||
.withSelection(
|
.withSelection(
|
||||||
CachedGroupMembership.MIMETYPE + "=? AND " + CachedGroupMembership.GROUP_ID + "=?",
|
CachedGroupMembership.MIMETYPE + "=? AND " + CachedGroupMembership.GROUP_ID + "=?",
|
||||||
arrayOf(CachedGroupMembership.CONTENT_ITEM_TYPE, id.toString())
|
arrayOf(CachedGroupMembership.CONTENT_ITEM_TYPE, id.toString())
|
||||||
)
|
)
|
||||||
))
|
)
|
||||||
|
|
||||||
// insert updated cached group memberships
|
// insert updated cached group memberships
|
||||||
for (member in getMembers())
|
for (member in getMembers())
|
||||||
batch.enqueue(BatchOperation.Operation(
|
batch.enqueue(BatchOperation.CpoBuilder.newInsert(addressBook.syncAdapterURI(ContactsContract.Data.CONTENT_URI))
|
||||||
ContentProviderOperation.newInsert(addressBook.syncAdapterURI(ContactsContract.Data.CONTENT_URI))
|
|
||||||
.withValue(CachedGroupMembership.MIMETYPE, CachedGroupMembership.CONTENT_ITEM_TYPE)
|
.withValue(CachedGroupMembership.MIMETYPE, CachedGroupMembership.CONTENT_ITEM_TYPE)
|
||||||
.withValue(CachedGroupMembership.RAW_CONTACT_ID, member)
|
.withValue(CachedGroupMembership.RAW_CONTACT_ID, member)
|
||||||
.withValue(CachedGroupMembership.GROUP_ID, id)
|
.withValue(CachedGroupMembership.GROUP_ID, id)
|
||||||
.withYieldAllowed(true)
|
)
|
||||||
))
|
|
||||||
|
|
||||||
batch.commit()
|
batch.commit()
|
||||||
}
|
}
|
||||||
@ -214,11 +211,9 @@ class LocalGroup : AndroidGroup, LocalAddress {
|
|||||||
.forEach { it.updateHashCode(batch) }
|
.forEach { it.updateHashCode(batch) }
|
||||||
|
|
||||||
// remove pending memberships
|
// remove pending memberships
|
||||||
batch.enqueue(BatchOperation.Operation(
|
batch.enqueue(BatchOperation.CpoBuilder.newUpdate(addressBook.syncAdapterURI(ContentUris.withAppendedId(Groups.CONTENT_URI, id)))
|
||||||
ContentProviderOperation.newUpdate(addressBook.syncAdapterURI(ContentUris.withAppendedId(Groups.CONTENT_URI, id)))
|
|
||||||
.withValue(COLUMN_PENDING_MEMBERS, null)
|
.withValue(COLUMN_PENDING_MEMBERS, null)
|
||||||
.withYieldAllowed(true)
|
)
|
||||||
))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -12,10 +12,7 @@ import android.content.ContentProviderOperation
|
|||||||
import android.content.ContentValues
|
import android.content.ContentValues
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.text.TextUtils
|
import android.text.TextUtils
|
||||||
import at.bitfire.ical4android.AndroidTask
|
import at.bitfire.ical4android.*
|
||||||
import at.bitfire.ical4android.AndroidTaskFactory
|
|
||||||
import at.bitfire.ical4android.AndroidTaskList
|
|
||||||
import at.bitfire.ical4android.Task
|
|
||||||
import com.etesync.syncadapter.log.Logger
|
import com.etesync.syncadapter.log.Logger
|
||||||
import org.dmfs.tasks.contract.TaskContract
|
import org.dmfs.tasks.contract.TaskContract
|
||||||
import java.io.ByteArrayOutputStream
|
import java.io.ByteArrayOutputStream
|
||||||
@ -75,7 +72,7 @@ class LocalTask : AndroidTask, LocalResource<Task> {
|
|||||||
task?.sequence = values.getAsInteger(COLUMN_SEQUENCE)
|
task?.sequence = values.getAsInteger(COLUMN_SEQUENCE)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun buildTask(builder: ContentProviderOperation.Builder, update: Boolean) {
|
override fun buildTask(builder: BatchOperation.CpoBuilder, update: Boolean) {
|
||||||
super.buildTask(builder, update)
|
super.buildTask(builder, update)
|
||||||
builder.withValue(TaskContract.Tasks._SYNC_ID, fileName)
|
builder.withValue(TaskContract.Tasks._SYNC_ID, fileName)
|
||||||
.withValue(COLUMN_UID, task?.uid)
|
.withValue(COLUMN_UID, task?.uid)
|
||||||
@ -98,7 +95,7 @@ class LocalTask : AndroidTask, LocalResource<Task> {
|
|||||||
|
|
||||||
override fun legacyPrepareForUpload(fileName_: String?) {
|
override fun legacyPrepareForUpload(fileName_: String?) {
|
||||||
var uid: String? = null
|
var uid: String? = null
|
||||||
val c = taskList.provider.client.query(taskSyncURI(), arrayOf(COLUMN_UID), null, null, null)
|
val c = taskList.provider.client.query(taskSyncURI(), arrayOf(COLUMN_UID), null, null, null)!!
|
||||||
if (c.moveToNext())
|
if (c.moveToNext())
|
||||||
uid = c.getString(0)
|
uid = c.getString(0)
|
||||||
if (uid == null)
|
if (uid == null)
|
||||||
|
@ -102,11 +102,9 @@ constructor(context: Context, account: Account, settings: AccountSettings, extra
|
|||||||
val currentGroups = contact.getGroupMemberships()
|
val currentGroups = contact.getGroupMemberships()
|
||||||
for (groupID in SetUtils.disjunction(cachedGroups, currentGroups)) {
|
for (groupID in SetUtils.disjunction(cachedGroups, currentGroups)) {
|
||||||
Logger.log.fine("Marking group as dirty: " + groupID!!)
|
Logger.log.fine("Marking group as dirty: " + groupID!!)
|
||||||
batch.enqueue(BatchOperation.Operation(
|
batch.enqueue(BatchOperation.CpoBuilder.newUpdate(addressBook.syncAdapterURI(ContentUris.withAppendedId(ContactsContract.Groups.CONTENT_URI, groupID)))
|
||||||
ContentProviderOperation.newUpdate(addressBook.syncAdapterURI(ContentUris.withAppendedId(ContactsContract.Groups.CONTENT_URI, groupID)))
|
|
||||||
.withValue(ContactsContract.Groups.DIRTY, 1)
|
.withValue(ContactsContract.Groups.DIRTY, 1)
|
||||||
.withYieldAllowed(true)
|
)
|
||||||
))
|
|
||||||
}
|
}
|
||||||
} catch (ignored: FileNotFoundException) {
|
} catch (ignored: FileNotFoundException) {
|
||||||
}
|
}
|
||||||
|
@ -100,7 +100,7 @@ class AboutActivity : BaseActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreateLoader(id: Int, args: Bundle?): Loader<Spanned> {
|
override fun onCreateLoader(id: Int, args: Bundle?): Loader<Spanned> {
|
||||||
return LicenseLoader(context!!, args!!.getString(KEY_FILE_NAME))
|
return LicenseLoader(requireContext(), args!!.getString(KEY_FILE_NAME)!!)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onLoadFinished(loader: Loader<Spanned>, license: Spanned) {
|
override fun onLoadFinished(loader: Loader<Spanned>, license: Spanned) {
|
||||||
|
@ -108,7 +108,7 @@ class AccountActivity : BaseActivity(), Toolbar.OnMenuItemClickListener, PopupMe
|
|||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
|
||||||
account = intent.getParcelableExtra(EXTRA_ACCOUNT)
|
account = intent.getParcelableExtra(EXTRA_ACCOUNT)!!
|
||||||
title = account.name
|
title = account.name
|
||||||
settings = AccountSettings(this, account)
|
settings = AccountSettings(this, account)
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ class AccountSettingsActivity : BaseActivity() {
|
|||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
|
||||||
account = intent.getParcelableExtra(KEY_ACCOUNT)
|
account = intent.getParcelableExtra(KEY_ACCOUNT)!!
|
||||||
title = getString(R.string.settings_title, account.name)
|
title = getString(R.string.settings_title, account.name)
|
||||||
|
|
||||||
supportActionBar!!.setDisplayHomeAsUpEnabled(true)
|
supportActionBar!!.setDisplayHomeAsUpEnabled(true)
|
||||||
@ -85,7 +85,7 @@ class AccountSettingsFragment() : PreferenceFragmentCompat(), LoaderManager.Load
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreateLoader(id: Int, args: Bundle?): Loader<AccountSettings> {
|
override fun onCreateLoader(id: Int, args: Bundle?): Loader<AccountSettings> {
|
||||||
return AccountSettingsLoader(context!!, args!!.getParcelable(KEY_ACCOUNT) as Account)
|
return AccountSettingsLoader(requireContext(), (args!!.getParcelable(KEY_ACCOUNT) as Account?)!!)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onLoadFinished(loader: Loader<AccountSettings>, settings: AccountSettings?) {
|
override fun onLoadFinished(loader: Loader<AccountSettings>, settings: AccountSettings?) {
|
||||||
@ -197,7 +197,7 @@ class LegacyAccountSettingsFragment : PreferenceFragmentCompat(), LoaderManager.
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreateLoader(id: Int, args: Bundle?): Loader<AccountSettings> {
|
override fun onCreateLoader(id: Int, args: Bundle?): Loader<AccountSettings> {
|
||||||
return AccountSettingsLoader(context!!, args!!.getParcelable(KEY_ACCOUNT) as Account)
|
return AccountSettingsLoader(context!!, (args!!.getParcelable(KEY_ACCOUNT) as? Account)!!)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onLoadFinished(loader: Loader<AccountSettings>, settings: AccountSettings?) {
|
override fun onLoadFinished(loader: Loader<AccountSettings>, settings: AccountSettings?) {
|
||||||
|
@ -68,7 +68,7 @@ class CollectionMembersActivity : BaseActivity(), Refreshable {
|
|||||||
|
|
||||||
supportActionBar!!.setDisplayHomeAsUpEnabled(true)
|
supportActionBar!!.setDisplayHomeAsUpEnabled(true)
|
||||||
|
|
||||||
account = intent.extras!!.getParcelable(EXTRA_ACCOUNT)
|
account = intent.extras!!.getParcelable(EXTRA_ACCOUNT)!!
|
||||||
info = intent.extras!!.getSerializable(EXTRA_COLLECTION_INFO) as CollectionInfo
|
info = intent.extras!!.getSerializable(EXTRA_COLLECTION_INFO) as CollectionInfo
|
||||||
|
|
||||||
refresh()
|
refresh()
|
||||||
|
@ -37,7 +37,7 @@ class CreateCollectionFragment : DialogFragment(), LoaderManager.LoaderCallbacks
|
|||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
|
||||||
account = arguments!!.getParcelable(ARG_ACCOUNT)
|
account = arguments!!.getParcelable(ARG_ACCOUNT)!!
|
||||||
info = arguments!!.getSerializable(ARG_COLLECTION_INFO) as CollectionInfo
|
info = arguments!!.getSerializable(ARG_COLLECTION_INFO) as CollectionInfo
|
||||||
|
|
||||||
loaderManager.initLoader(0, null, this)
|
loaderManager.initLoader(0, null, this)
|
||||||
|
@ -31,7 +31,7 @@ class WebViewActivity : BaseActivity() {
|
|||||||
mToolbar = supportActionBar
|
mToolbar = supportActionBar
|
||||||
mToolbar!!.setDisplayHomeAsUpEnabled(true)
|
mToolbar!!.setDisplayHomeAsUpEnabled(true)
|
||||||
|
|
||||||
var uri = intent.getParcelableExtra<Uri>(KEY_URL)
|
var uri = intent.getParcelableExtra<Uri>(KEY_URL)!!
|
||||||
uri = addQueryParams(uri)
|
uri = addQueryParams(uri)
|
||||||
mWebView = findViewById<View>(R.id.webView) as WebView
|
mWebView = findViewById<View>(R.id.webView) as WebView
|
||||||
mProgressBar = findViewById<View>(R.id.progressBar) as ProgressBar
|
mProgressBar = findViewById<View>(R.id.progressBar) as ProgressBar
|
||||||
|
@ -98,7 +98,7 @@ class ItemRevisionsListFragment : ListFragment(), AdapterView.OnItemClickListene
|
|||||||
if (v == null)
|
if (v == null)
|
||||||
v = LayoutInflater.from(context).inflate(R.layout.journal_viewer_list_item, parent, false)!!
|
v = LayoutInflater.from(context).inflate(R.layout.journal_viewer_list_item, parent, false)!!
|
||||||
|
|
||||||
val item = getItem(position)
|
val item = getItem(position)!!
|
||||||
|
|
||||||
setItemView(v, cachedCollection.collectionType, item)
|
setItemView(v, cachedCollection.collectionType, item)
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ class ListEntriesFragment : ListFragment(), AdapterView.OnItemClickListener {
|
|||||||
if (v == null)
|
if (v == null)
|
||||||
v = LayoutInflater.from(context).inflate(R.layout.journal_viewer_list_item, parent, false)!!
|
v = LayoutInflater.from(context).inflate(R.layout.journal_viewer_list_item, parent, false)!!
|
||||||
|
|
||||||
val item = getItem(position)
|
val item = getItem(position)!!
|
||||||
|
|
||||||
setItemView(v, cachedCollection.collectionType, item)
|
setItemView(v, cachedCollection.collectionType, item)
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ class LoginCredentialsChangeFragment : DialogFragment(), LoaderManager.LoaderCal
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreateLoader(id: Int, args: Bundle?): Loader<Configuration> {
|
override fun onCreateLoader(id: Int, args: Bundle?): Loader<Configuration> {
|
||||||
return ServerConfigurationLoader(context!!, args!!.getParcelable(ARG_LOGIN_CREDENTIALS) as LoginCredentials)
|
return ServerConfigurationLoader(requireContext(), (args!!.getParcelable(ARG_LOGIN_CREDENTIALS) as LoginCredentials?)!!)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onLoadFinished(loader: Loader<Configuration>, data: Configuration?) {
|
override fun onLoadFinished(loader: Loader<Configuration>, data: Configuration?) {
|
||||||
|
Loading…
Reference in New Issue
Block a user