From 946ae32cd803b96518392f1eda13df5ac5662e03 Mon Sep 17 00:00:00 2001 From: ganfra Date: Thu, 24 Jan 2019 16:30:05 +0100 Subject: [PATCH] Let the app be compatible with android 16 --- app/build.gradle | 4 +++- app/src/main/java/im/vector/riotredesign/Riot.kt | 8 ++++++++ .../features/home/room/list/RoomCategoryItem.kt | 8 +++++--- matrix-sdk-android/build.gradle | 2 +- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index e9f9a3e985..8bfee140f6 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -15,8 +15,9 @@ android { compileSdkVersion 28 defaultConfig { applicationId "im.vector.riotredesign" - minSdkVersion 21 + minSdkVersion 16 targetSdkVersion 28 + multiDexEnabled true versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" @@ -42,6 +43,7 @@ dependencies { implementation project(":matrix-sdk-android") implementation project(":matrix-sdk-android-rx") + implementation 'com.android.support:multidex:1.0.3' implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" diff --git a/app/src/main/java/im/vector/riotredesign/Riot.kt b/app/src/main/java/im/vector/riotredesign/Riot.kt index 052c717930..40f91e1cb8 100644 --- a/app/src/main/java/im/vector/riotredesign/Riot.kt +++ b/app/src/main/java/im/vector/riotredesign/Riot.kt @@ -1,6 +1,8 @@ package im.vector.riotredesign import android.app.Application +import android.content.Context +import androidx.multidex.MultiDex import com.jakewharton.threetenabp.AndroidThreeTen import im.vector.matrix.android.BuildConfig import im.vector.riotredesign.core.di.AppModule @@ -8,6 +10,7 @@ import org.koin.log.EmptyLogger import org.koin.standalone.StandAloneContext.startKoin import timber.log.Timber + class Riot : Application() { override fun onCreate() { @@ -19,4 +22,9 @@ class Riot : Application() { startKoin(listOf(AppModule(this).definition), logger = EmptyLogger()) } + override fun attachBaseContext(base: Context) { + super.attachBaseContext(base) + MultiDex.install(this) + } + } \ No newline at end of file diff --git a/app/src/main/java/im/vector/riotredesign/features/home/room/list/RoomCategoryItem.kt b/app/src/main/java/im/vector/riotredesign/features/home/room/list/RoomCategoryItem.kt index ec17904654..929ba659b5 100644 --- a/app/src/main/java/im/vector/riotredesign/features/home/room/list/RoomCategoryItem.kt +++ b/app/src/main/java/im/vector/riotredesign/features/home/room/list/RoomCategoryItem.kt @@ -1,8 +1,9 @@ package im.vector.riotredesign.features.home.room.list -import androidx.core.content.ContextCompat import android.view.ViewGroup import android.widget.TextView +import androidx.core.content.ContextCompat +import androidx.core.graphics.drawable.DrawableCompat import im.vector.riotredesign.R import im.vector.riotredesign.core.epoxy.KotlinModel @@ -21,8 +22,9 @@ data class RoomCategoryItem( override fun bind() { val expandedArrowDrawableRes = if (isExpanded) R.drawable.ic_expand_more_white else R.drawable.ic_expand_less_white - val expandedArrowDrawable = ContextCompat.getDrawable(rootView.context, expandedArrowDrawableRes) - expandedArrowDrawable?.setTint(tintColor) + val expandedArrowDrawable = ContextCompat.getDrawable(rootView.context, expandedArrowDrawableRes)?.also { + DrawableCompat.setTint(it, tintColor) + } titleView.setCompoundDrawablesWithIntrinsicBounds(expandedArrowDrawable, null, null, null) titleView.text = title rootView.setOnClickListener { listener?.invoke() } diff --git a/matrix-sdk-android/build.gradle b/matrix-sdk-android/build.gradle index c7ca4b5d7a..47e0f16041 100644 --- a/matrix-sdk-android/build.gradle +++ b/matrix-sdk-android/build.gradle @@ -24,7 +24,7 @@ android { testOptions.unitTests.includeAndroidResources = true defaultConfig { - minSdkVersion 21 + minSdkVersion 16 targetSdkVersion 28 versionCode 1 versionName "1.0"