Initial fixes to support targetSdk 29.

This commit is contained in:
onurays 2020-03-26 12:06:50 +03:00
parent 08cfe79625
commit c63f3edb06
8 changed files with 14 additions and 13 deletions

View file

@ -3,11 +3,11 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
android {
compileSdkVersion 28
compileSdkVersion 29
defaultConfig {
minSdkVersion 16
targetSdkVersion 28
targetSdkVersion 29
versionCode 1
versionName "1.0"

View file

@ -19,12 +19,12 @@ androidExtensions {
}
android {
compileSdkVersion 28
compileSdkVersion 29
testOptions.unitTests.includeAndroidResources = true
defaultConfig {
minSdkVersion 16
targetSdkVersion 28
targetSdkVersion 29
versionCode 1
versionName "0.0.1"
// Multidex is useful for tests

View file

@ -68,7 +68,7 @@ internal class ShareSecretCryptoProvider @Inject constructor(
fun decryptEvent(event: Event): MXEventDecryptionResult {
return runBlocking(coroutineDispatchers.crypto) {
olmDecryptionFactory.create().decryptEvent(event, ShareSecretCryptoProvider::class.java.name ?: "")
olmDecryptionFactory.create().decryptEvent(event, ShareSecretCryptoProvider::class.java.name)
}
}
}

View file

@ -25,8 +25,9 @@ internal class Debouncer(private val handler: Handler) {
fun debounce(identifier: String, r: Runnable, millis: Long): Boolean {
if (runnables.containsKey(identifier)) {
// debounce
val old = runnables[identifier]
handler.removeCallbacks(old)
runnables[identifier]?.let {
handler.removeCallbacks(it)
}
}
insertRunnable(identifier, r, millis)
return true

View file

@ -104,13 +104,13 @@ ext.abiVersionCodes = ["armeabi-v7a": 1, "arm64-v8a": 2, "x86": 3, "x86_64": 4].
def buildNumber = System.env.BUILDKITE_BUILD_NUMBER as Integer ?: 0
android {
compileSdkVersion 28
compileSdkVersion 29
defaultConfig {
applicationId "im.vector.riotx"
// Set to API 19 because motionLayout is min API 18.
// In the future we may consider using an alternative of MotionLayout to support API 16. But for security reason, maybe not.
minSdkVersion 19
targetSdkVersion 28
targetSdkVersion 29
multiDexEnabled true
// `develop` branch will have version code from timestamp, to ensure each build from CI has a incremented versionCode.

View file

@ -84,7 +84,7 @@ fun requestDisablingBatteryOptimization(activity: Activity, fragment: Fragment?,
*/
fun copyToClipboard(context: Context, text: CharSequence, showToast: Boolean = true, @StringRes toastMessage: Int = R.string.copied_to_clipboard) {
val clipboard = context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
clipboard.primaryClip = ClipData.newPlainText("", text)
clipboard.setPrimaryClip(ClipData.newPlainText("", text))
if (showToast) {
context.toast(toastMessage)
}

View file

@ -95,7 +95,7 @@ class KeysBackupRestoreFromPassphraseFragment @Inject constructor(): VectorBaseF
// used just to have default link representation
val clickableSpan = object : ClickableSpan() {
override fun onClick(widget: View?) {}
override fun onClick(widget: View) {}
}
val start = helperText.indexOf(clickableText)
val end = start + clickableText.length

View file

@ -440,11 +440,11 @@ class MessageItemFactory @Inject constructor(
Spanned.SPAN_INCLUSIVE_EXCLUSIVE)
spannable.setSpan(object : ClickableSpan() {
override fun onClick(widget: View?) {
override fun onClick(widget: View) {
callback?.onEditedDecorationClicked(informationData)
}
override fun updateDrawState(ds: TextPaint?) {
override fun updateDrawState(ds: TextPaint) {
// nop
}
},