From e38c720d1a8ebf09d13d9cb43da9ec36c471b46c Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Sat, 5 Jan 2019 15:40:17 +0000 Subject: [PATCH] Kotlin: more kotlin migration. --- .../java/com/etesync/syncadapter/ui/AccountActivity.kt | 2 +- .../etesync/syncadapter/ui/AccountSettingsActivity.kt | 2 +- .../com/etesync/syncadapter/ui/AddMemberFragment.kt | 10 +++++----- .../syncadapter/ui/importlocal/ImportFragment.kt | 4 ++-- .../ui/importlocal/LocalCalendarImportFragment.kt | 4 ++-- .../ui/importlocal/LocalContactImportFragment.kt | 4 ++-- .../ui/setup/LoginCredentialsChangeFragment.kt | 2 +- .../syncadapter/ui/setup/SetupUserInfoFragment.kt | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/app/src/main/java/com/etesync/syncadapter/ui/AccountActivity.kt b/app/src/main/java/com/etesync/syncadapter/ui/AccountActivity.kt index 24788cb7..2a857d77 100644 --- a/app/src/main/java/com/etesync/syncadapter/ui/AccountActivity.kt +++ b/app/src/main/java/com/etesync/syncadapter/ui/AccountActivity.kt @@ -46,7 +46,7 @@ import java.util.logging.Level class AccountActivity : BaseActivity(), Toolbar.OnMenuItemClickListener, PopupMenu.OnMenuItemClickListener, LoaderManager.LoaderCallbacks, Refreshable { - private var account: Account? = null + private lateinit var account: Account private var accountInfo: AccountInfo? = null internal var listCalDAV: ListView? = null diff --git a/app/src/main/java/com/etesync/syncadapter/ui/AccountSettingsActivity.kt b/app/src/main/java/com/etesync/syncadapter/ui/AccountSettingsActivity.kt index 352b92d2..299b1c65 100644 --- a/app/src/main/java/com/etesync/syncadapter/ui/AccountSettingsActivity.kt +++ b/app/src/main/java/com/etesync/syncadapter/ui/AccountSettingsActivity.kt @@ -31,7 +31,7 @@ import com.etesync.syncadapter.ui.setup.LoginCredentials import com.etesync.syncadapter.ui.setup.LoginCredentialsChangeFragment class AccountSettingsActivity : BaseActivity() { - private var account: Account? = null + private lateinit var account: Account override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) diff --git a/app/src/main/java/com/etesync/syncadapter/ui/AddMemberFragment.kt b/app/src/main/java/com/etesync/syncadapter/ui/AddMemberFragment.kt index d10602bc..5a8edee7 100644 --- a/app/src/main/java/com/etesync/syncadapter/ui/AddMemberFragment.kt +++ b/app/src/main/java/com/etesync/syncadapter/ui/AddMemberFragment.kt @@ -19,13 +19,13 @@ import com.etesync.syncadapter.model.CollectionInfo import okhttp3.HttpUrl class AddMemberFragment : DialogFragment() { - private var account: Account? = null + private lateinit var account: Account private var settings: AccountSettings? = null private var ctx: Context? = null private var remote: HttpUrl? = null - private var info: CollectionInfo? = null - private var memberEmail: String? = null - private var memberPubKey: ByteArray? = null + private lateinit var info: CollectionInfo + private lateinit var memberEmail: String + private lateinit var memberPubKey: ByteArray override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -62,7 +62,7 @@ class AddMemberFragment : DialogFragment() { val userInfo = userInfoManager[memberEmail!!] ?: throw Exception(getString(R.string.collection_members_error_user_not_found, memberEmail)) - memberPubKey = userInfo.pubkey + memberPubKey = userInfo.pubkey!! return AddResult(null) } catch (e: Exception) { return AddResult(e) diff --git a/app/src/main/java/com/etesync/syncadapter/ui/importlocal/ImportFragment.kt b/app/src/main/java/com/etesync/syncadapter/ui/importlocal/ImportFragment.kt index 8401c218..372a490d 100644 --- a/app/src/main/java/com/etesync/syncadapter/ui/importlocal/ImportFragment.kt +++ b/app/src/main/java/com/etesync/syncadapter/ui/importlocal/ImportFragment.kt @@ -39,8 +39,8 @@ import java.io.IOException class ImportFragment : DialogFragment() { - private var account: Account? = null - private var info: CollectionInfo? = null + private lateinit var account: Account + private lateinit var info: CollectionInfo private var importFile: File? = null override fun onCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/etesync/syncadapter/ui/importlocal/LocalCalendarImportFragment.kt b/app/src/main/java/com/etesync/syncadapter/ui/importlocal/LocalCalendarImportFragment.kt index 9cbdc082..2aa9c0dd 100644 --- a/app/src/main/java/com/etesync/syncadapter/ui/importlocal/LocalCalendarImportFragment.kt +++ b/app/src/main/java/com/etesync/syncadapter/ui/importlocal/LocalCalendarImportFragment.kt @@ -24,8 +24,8 @@ import com.etesync.syncadapter.resource.LocalEvent class LocalCalendarImportFragment : ListFragment() { - private var account: Account? = null - private var info: CollectionInfo? = null + private lateinit var account: Account + private lateinit var info: CollectionInfo override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) diff --git a/app/src/main/java/com/etesync/syncadapter/ui/importlocal/LocalContactImportFragment.kt b/app/src/main/java/com/etesync/syncadapter/ui/importlocal/LocalContactImportFragment.kt index 20bcce36..805828f0 100644 --- a/app/src/main/java/com/etesync/syncadapter/ui/importlocal/LocalContactImportFragment.kt +++ b/app/src/main/java/com/etesync/syncadapter/ui/importlocal/LocalContactImportFragment.kt @@ -31,8 +31,8 @@ import java.util.* class LocalContactImportFragment : Fragment() { - private var account: Account? = null - private var info: CollectionInfo? = null + private lateinit var account: Account + private lateinit var info: CollectionInfo private var recyclerView: RecyclerView? = null override fun onCreate(savedInstanceState: Bundle?) { diff --git a/app/src/main/java/com/etesync/syncadapter/ui/setup/LoginCredentialsChangeFragment.kt b/app/src/main/java/com/etesync/syncadapter/ui/setup/LoginCredentialsChangeFragment.kt index 829a6ff4..40b8a236 100644 --- a/app/src/main/java/com/etesync/syncadapter/ui/setup/LoginCredentialsChangeFragment.kt +++ b/app/src/main/java/com/etesync/syncadapter/ui/setup/LoginCredentialsChangeFragment.kt @@ -28,7 +28,7 @@ import com.etesync.syncadapter.ui.setup.BaseConfigurationFinder.Configuration import java.util.logging.Level class LoginCredentialsChangeFragment : DialogFragment(), LoaderManager.LoaderCallbacks { - private var account: Account? = null + private lateinit var account: Account override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { val progress = ProgressDialog(activity) diff --git a/app/src/main/java/com/etesync/syncadapter/ui/setup/SetupUserInfoFragment.kt b/app/src/main/java/com/etesync/syncadapter/ui/setup/SetupUserInfoFragment.kt index 2a72e49a..18c8ba99 100644 --- a/app/src/main/java/com/etesync/syncadapter/ui/setup/SetupUserInfoFragment.kt +++ b/app/src/main/java/com/etesync/syncadapter/ui/setup/SetupUserInfoFragment.kt @@ -16,8 +16,8 @@ import com.etesync.syncadapter.journalmanager.UserInfoManager import okhttp3.HttpUrl class SetupUserInfoFragment : DialogFragment() { - private var account: Account? = null - private var settings: AccountSettings? = null + private lateinit var account: Account + private lateinit var settings: AccountSettings override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { val progress = ProgressDialog(activity)