Commit 9a0cd64f authored by Ricki Hirner's avatar Ricki Hirner 🐑

SDK/build tools 27

parent 591a4ad4
......@@ -11,8 +11,8 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
compileSdkVersion 27
buildToolsVersion '27.0.0'
defaultConfig {
applicationId "at.bitfire.davdroid"
......@@ -73,10 +73,10 @@ dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:cardview-v7:26.1.0'
compile 'com.android.support:design:26.1.0'
compile 'com.android.support:preference-v14:26.1.0'
compile 'com.android.support:appcompat-v7:27.0.0'
compile 'com.android.support:cardview-v7:27.0.0'
compile 'com.android.support:design:27.0.0'
compile 'com.android.support:preference-v14:27.0.0'
compile 'com.github.yukuku:ambilwarna:2.0.1'
......
......@@ -24,6 +24,7 @@
# ical4j: ignore unused dynamic libraries
-dontwarn aQute.**
-dontwarn groovy.** # Groovy-based ContentBuilder not used
-dontwarn javax.cache.** # no JCache support in Android
-dontwarn net.fortuna.ical4j.model.**
-dontwarn org.codehaus.groovy.**
-dontwarn org.apache.log4j.** # ignore warnings from log4j dependency
......
......@@ -18,8 +18,8 @@ import android.content.Intent
import android.database.DatabaseUtils
import android.database.sqlite.SQLiteDatabase
import android.os.Binder
import android.support.v4.app.NotificationCompat
import android.support.v4.app.NotificationManagerCompat
import android.support.v7.app.NotificationCompat
import at.bitfire.dav4android.DavResource
import at.bitfire.dav4android.UrlUtils
import at.bitfire.dav4android.exception.DavException
......
......@@ -15,8 +15,8 @@ import android.content.Intent
import android.content.SyncResult
import android.net.Uri
import android.os.Bundle
import android.support.v4.app.NotificationCompat
import android.support.v4.app.NotificationManagerCompat
import android.support.v7.app.NotificationCompat
import at.bitfire.dav4android.DavResource
import at.bitfire.dav4android.exception.*
import at.bitfire.dav4android.property.GetCTag
......
......@@ -124,7 +124,7 @@ class AboutActivity: AppCompatActivity() {
@SuppressLint("SetTextI18n")
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
val info = (activity as AboutActivity).components[arguments.getInt(KEY_POSITION)]
val info = (activity as AboutActivity).components[arguments!!.getInt(KEY_POSITION)]
val v = inflater.inflate(R.layout.about_component, container, false)
......@@ -140,7 +140,7 @@ class AboutActivity: AppCompatActivity() {
if (info.licenseInfo == null && info.licenseTextFile == null) {
// No license text, so this must be the app's tab. Show the license fragment here, if available.
licenseFragmentLoader?.let { factory ->
fragmentManager.beginTransaction()
fragmentManager!!.beginTransaction()
.add(R.id.license_fragment, factory.getFragment())
.commit()
}
......@@ -169,7 +169,7 @@ class AboutActivity: AppCompatActivity() {
}
override fun onCreateLoader(id: Int, args: Bundle) =
LicenseLoader(context, args.getString(KEY_FILE_NAME))
LicenseLoader(activity!!, args.getString(KEY_FILE_NAME))
override fun onLoadFinished(loader: Loader<Spanned>, license: Spanned?) {
view?.let { v ->
......
......@@ -582,12 +582,12 @@ class AccountActivity: AppCompatActivity(), Toolbar.OnMenuItemClickListener, Pop
}
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
val oldAccount: Account = arguments.getParcelable(ARG_ACCOUNT)
val oldAccount: Account = arguments!!.getParcelable(ARG_ACCOUNT)
val editText = EditText(activity)
editText.setText(oldAccount.name)
return AlertDialog.Builder(activity)
return AlertDialog.Builder(activity!!)
.setTitle(R.string.account_rename)
.setMessage(R.string.account_rename_new_name)
.setView(editText)
......@@ -608,17 +608,17 @@ class AccountActivity: AppCompatActivity(), Toolbar.OnMenuItemClickListener, Pop
ContentResolver.cancelSync(addrBookAccount, null)
// update account name references in database
OpenHelper(activity).use { dbHelper ->
ServiceDB.onRenameAccount(dbHelper.getWritableDatabase(), oldAccount.name, newName)
OpenHelper(activity!!).use { dbHelper ->
ServiceDB.onRenameAccount(dbHelper.writableDatabase, oldAccount.name, newName)
}
// update main account of address book accounts
try {
for (addrBookAccount in accountManager.getAccountsByType(getString(R.string.account_type_address_book))) {
val provider = activity.contentResolver.acquireContentProviderClient(ContactsContract.AUTHORITY)
val provider = activity!!.contentResolver.acquireContentProviderClient(ContactsContract.AUTHORITY)
try {
if (provider != null) {
val addressBook = LocalAddressBook(activity, addrBookAccount, provider)
val addressBook = LocalAddressBook(activity!!, addrBookAccount, provider)
if (oldAccount == addressBook.getMainAccount())
addressBook.setMainAccount(Account(newName, oldAccount.type))
}
......@@ -639,15 +639,15 @@ class AccountActivity: AppCompatActivity(), Toolbar.OnMenuItemClickListener, Pop
// update account_name of local tasks
try {
LocalTaskList.onRenameAccount(activity.contentResolver, oldAccount.name, newName)
LocalTaskList.onRenameAccount(activity!!.contentResolver, oldAccount.name, newName)
} catch(e: Exception) {
Logger.log.log(Level.SEVERE, "Couldn't propagate new account name to tasks provider", e)
}
// synchronize again
requestSync(activity, Account(newName, oldAccount.type))
requestSync(activity!!, Account(newName, oldAccount.type))
}, null)
activity.finish()
activity!!.finish()
})
.setNegativeButton(android.R.string.cancel, { _, _ -> })
.create()
......
......@@ -76,13 +76,13 @@ class AppSettingsActivity: AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
if (!activity.bindService(Intent(activity, Settings::class.java), settingsSvc, Context.BIND_AUTO_CREATE))
if (!activity!!.bindService(Intent(activity, Settings::class.java), settingsSvc, Context.BIND_AUTO_CREATE))
settingsSvc = null
}
override fun onDestroy() {
super.onDestroy()
settingsSvc?.let { activity.unbindService(it) }
settingsSvc?.let { activity!!.unbindService(it) }
}
override fun onCreatePreferences(bundle: Bundle?, s: String?) {
......@@ -162,7 +162,7 @@ class AppSettingsActivity: AppCompatActivity() {
val prefLogToExternalStorage = findPreference(Logger.LOG_TO_EXTERNAL_STORAGE) as SwitchPreferenceCompat
prefLogToExternalStorage.onPreferenceChangeListener = Preference.OnPreferenceChangeListener { _, newValue ->
// kill a potential :sync process, so that the new logger settings will be used
val am = activity.getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager
val am = activity!!.getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager
am.runningAppProcesses.forEach {
if (it.pid != Process.myPid()) {
Logger.log.info("Killing ${it.processName} process, pid = ${it.pid}")
......@@ -181,7 +181,7 @@ class AppSettingsActivity: AppCompatActivity() {
}
private fun resetCertificates() {
if (CustomCertManager.resetCertificates(activity))
if (CustomCertManager.resetCertificates(activity!!))
Snackbar.make(view!!, getString(R.string.app_settings_reset_certificates_success), Snackbar.LENGTH_LONG).show()
}
......
......@@ -55,8 +55,8 @@ class CreateCollectionFragment: DialogFragment(), LoaderManager.LoaderCallbacks<
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
account = arguments.getParcelable(ARG_ACCOUNT)
info = arguments.getSerializable(ARG_COLLECTION_INFO) as CollectionInfo
account = arguments!!.getParcelable(ARG_ACCOUNT)
info = arguments!!.getSerializable(ARG_COLLECTION_INFO) as CollectionInfo
loaderManager.initLoader(0, null, this)
}
......@@ -72,14 +72,14 @@ class CreateCollectionFragment: DialogFragment(), LoaderManager.LoaderCallbacks<
}
override fun onCreateLoader(id: Int, args: Bundle?) = CreateCollectionLoader(context, account, info)
override fun onCreateLoader(id: Int, args: Bundle?) = CreateCollectionLoader(activity!!, account, info)
override fun onLoadFinished(loader: Loader<Exception>, exception: Exception?) {
dismissAllowingStateLoss()
activity?.let { parent ->
if (exception != null)
fragmentManager.beginTransaction()
fragmentManager!!.beginTransaction()
.add(ExceptionInfoFragment.newInstance(exception, account), null)
.commitAllowingStateLoss()
else
......
......@@ -39,8 +39,8 @@ class DeleteCollectionFragment: DialogFragment(), LoaderManager.LoaderCallbacks<
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
account = arguments.getParcelable(ARG_ACCOUNT)
collectionInfo = arguments.getSerializable(ARG_COLLECTION_INFO) as CollectionInfo
account = arguments!!.getParcelable(ARG_ACCOUNT)
collectionInfo = arguments!!.getSerializable(ARG_COLLECTION_INFO) as CollectionInfo
loaderManager.initLoader(0, null, this)
}
......@@ -57,13 +57,13 @@ class DeleteCollectionFragment: DialogFragment(), LoaderManager.LoaderCallbacks<
override fun onCreateLoader(id: Int, args: Bundle?) =
DeleteCollectionLoader(context, account, collectionInfo)
DeleteCollectionLoader(activity!!, account, collectionInfo)
override fun onLoadFinished(loader: Loader<Exception>, exception: Exception?) {
dismissAllowingStateLoss()
if (exception != null)
fragmentManager.beginTransaction()
fragmentManager!!.beginTransaction()
.add(ExceptionInfoFragment.newInstance(exception, account), null)
.commitAllowingStateLoss()
else
......@@ -124,13 +124,13 @@ class DeleteCollectionFragment: DialogFragment(), LoaderManager.LoaderCallbacks<
}
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
val collectionInfo = arguments.getSerializable(ARG_COLLECTION_INFO) as CollectionInfo
val collectionInfo = arguments!!.getSerializable(ARG_COLLECTION_INFO) as CollectionInfo
val name = if (collectionInfo.displayName.isNullOrBlank())
collectionInfo.url
else
collectionInfo.displayName
return AlertDialog.Builder(context)
return AlertDialog.Builder(activity!!)
.setTitle(R.string.delete_collection_confirm_title)
.setMessage(getString(R.string.delete_collection_confirm_warning, name))
.setPositiveButton(android.R.string.yes, { _, _ ->
......
......@@ -35,8 +35,8 @@ class ExceptionInfoFragment: DialogFragment() {
}
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
val exception = arguments.getSerializable(ARG_EXCEPTION) as Exception
val account: Account? = arguments.getParcelable(ARG_ACCOUNT)
val exception = arguments!!.getSerializable(ARG_EXCEPTION) as Exception
val account: Account? = arguments!!.getParcelable(ARG_ACCOUNT)
val title = when (exception) {
is HttpException -> R.string.exception_httpexception
......@@ -44,12 +44,12 @@ class ExceptionInfoFragment: DialogFragment() {
else -> R.string.exception
}
val dialog = AlertDialog.Builder(context)
val dialog = AlertDialog.Builder(activity!!)
.setIcon(R.drawable.ic_error_dark)
.setTitle(title)
.setMessage(exception::class.java.name + "\n" + exception.localizedMessage)
.setNegativeButton(R.string.exception_show_details, { _, _ ->
val intent = Intent(getContext(), DebugInfoActivity::class.java)
val intent = Intent(activity, DebugInfoActivity::class.java)
intent.putExtra(DebugInfoActivity.KEY_THROWABLE, exception)
account?.let { intent.putExtra(DebugInfoActivity.KEY_ACCOUNT, it) }
startActivity(intent)
......
Subproject commit fb3b55af4194b58bb4c0696c6bdf1262612d357f
Subproject commit 0cd2281f2c08430868e0be404d8dbff209dc30ae
Subproject commit 7054c635a2591d4a859d5f7b51f4cb7135bbcd1c
Subproject commit 11cdaae4f3dd9b8b10c34975d9132fabef7d54dc
Subproject commit c89046a96e11df682c146e28fbfbd5c5ccb93a80
Subproject commit 1be2579cd0e8025c5753cdc4790a9eb64d7818ad
Subproject commit 48818380683c56ba36aff1809ae0b56e267dccb7
Subproject commit 39d1dfa6bfcbcdbeb14eb2387244f76141b030b5
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment