From 941cdf198a7aaa4e38767dee04073c4fb67bf6bb Mon Sep 17 00:00:00 2001 From: Konrad Pozniak Date: Sun, 28 Jul 2019 20:00:19 +0200 Subject: [PATCH] upgrade dagger (#1424) --- app/build.gradle | 2 +- .../instancemute/InstanceListActivity.kt | 15 ++++++--------- .../tusky/components/report/ReportActivity.kt | 10 ++++------ 3 files changed, 11 insertions(+), 16 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index cd1b909c9..3b8047c60 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -86,7 +86,7 @@ project.tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { } } -ext.daggerVersion = '2.23.2' +ext.daggerVersion = '2.24' ext.retrofitVersion = '2.6.0' // if libraries are changed here, they should also be changed in LicenseActivity diff --git a/app/src/main/java/com/keylesspalace/tusky/components/instancemute/InstanceListActivity.kt b/app/src/main/java/com/keylesspalace/tusky/components/instancemute/InstanceListActivity.kt index 7aa39befe..f4505ad69 100644 --- a/app/src/main/java/com/keylesspalace/tusky/components/instancemute/InstanceListActivity.kt +++ b/app/src/main/java/com/keylesspalace/tusky/components/instancemute/InstanceListActivity.kt @@ -2,23 +2,18 @@ package com.keylesspalace.tusky.components.instancemute import android.os.Bundle import android.view.MenuItem -import androidx.fragment.app.Fragment import com.keylesspalace.tusky.BaseActivity import com.keylesspalace.tusky.R import com.keylesspalace.tusky.components.instancemute.fragment.InstanceListFragment -import dagger.android.AndroidInjector import dagger.android.DispatchingAndroidInjector -import dagger.android.support.HasSupportFragmentInjector +import dagger.android.HasAndroidInjector import javax.inject.Inject import kotlinx.android.synthetic.main.toolbar_basic.* -class InstanceListActivity: BaseActivity(), HasSupportFragmentInjector { - @Inject - lateinit var dispatchingAndroidInjector: DispatchingAndroidInjector +class InstanceListActivity: BaseActivity(), HasAndroidInjector { - override fun supportFragmentInjector(): AndroidInjector? { - return dispatchingAndroidInjector - } + @Inject + lateinit var androidInjector: DispatchingAndroidInjector override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -47,4 +42,6 @@ class InstanceListActivity: BaseActivity(), HasSupportFragmentInjector { return super.onOptionsItemSelected(item) } + override fun androidInjector() = androidInjector + } \ No newline at end of file diff --git a/app/src/main/java/com/keylesspalace/tusky/components/report/ReportActivity.kt b/app/src/main/java/com/keylesspalace/tusky/components/report/ReportActivity.kt index 170c108a4..762a805fc 100644 --- a/app/src/main/java/com/keylesspalace/tusky/components/report/ReportActivity.kt +++ b/app/src/main/java/com/keylesspalace/tusky/components/report/ReportActivity.kt @@ -21,7 +21,6 @@ import android.os.Bundle import android.text.Spanned import android.view.MenuItem import androidx.appcompat.content.res.AppCompatResources -import androidx.fragment.app.Fragment import androidx.lifecycle.Observer import androidx.lifecycle.ViewModelProviders import com.keylesspalace.tusky.BottomSheetActivity @@ -30,18 +29,17 @@ import com.keylesspalace.tusky.components.report.adapter.ReportPagerAdapter import com.keylesspalace.tusky.di.ViewModelFactory import com.keylesspalace.tusky.util.HtmlUtils import com.keylesspalace.tusky.util.ThemeUtils -import dagger.android.AndroidInjector import dagger.android.DispatchingAndroidInjector -import dagger.android.support.HasSupportFragmentInjector +import dagger.android.HasAndroidInjector import kotlinx.android.synthetic.main.activity_report.* import kotlinx.android.synthetic.main.toolbar_basic.* import javax.inject.Inject -class ReportActivity : BottomSheetActivity(), HasSupportFragmentInjector { +class ReportActivity : BottomSheetActivity(), HasAndroidInjector { @Inject - lateinit var dispatchingFragmentInjector: DispatchingAndroidInjector + lateinit var androidInjector: DispatchingAndroidInjector @Inject lateinit var viewModelFactory: ViewModelFactory @@ -158,5 +156,5 @@ class ReportActivity : BottomSheetActivity(), HasSupportFragmentInjector { } } - override fun supportFragmentInjector(): AndroidInjector = dispatchingFragmentInjector + override fun androidInjector() = androidInjector }