From 05d939b68a38e34a551d959cea708b6a33a08d09 Mon Sep 17 00:00:00 2001 From: Konrad Pozniak Date: Sun, 9 Jun 2019 19:48:04 +0200 Subject: [PATCH] Update Dagger & other deps (#1315) * update dagger * update remaining deps --- app/build.gradle | 20 +++++------ .../keylesspalace/tusky/AccountActivity.kt | 12 +++---- .../tusky/AccountListActivity.kt | 19 ++++------- .../tusky/FavouritesActivity.java | 15 ++++----- .../com/keylesspalace/tusky/ListsActivity.kt | 9 +++-- .../com/keylesspalace/tusky/MainActivity.java | 10 +++--- .../tusky/ModalTimelineActivity.kt | 14 +++----- .../tusky/PreferencesActivity.kt | 12 +++---- .../keylesspalace/tusky/SearchActivity.java | 18 +++++----- .../keylesspalace/tusky/TuskyApplication.java | 33 +++++-------------- .../keylesspalace/tusky/ViewTagActivity.java | 16 ++++----- .../tusky/ViewThreadActivity.java | 9 +++-- .../com/keylesspalace/tusky/di/AppInjector.kt | 4 +-- 13 files changed, 77 insertions(+), 114 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 14aaa11a5..e93db150c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -86,7 +86,8 @@ project.tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { } } -ext.daggerVersion = '2.22.1' +ext.daggerVersion = '2.23.1' +ext.retrofitVersion = '2.6.0' // if libraries are changed here, they should also be changed in LicenseActivity dependencies { @@ -102,9 +103,9 @@ dependencies { implementation 'androidx.exifinterface:exifinterface:1.0.0' implementation 'androidx.cardview:cardview:1.0.0' implementation 'androidx.preference:preference:1.1.0-alpha04' - implementation 'com.squareup.retrofit2:retrofit:2.5.0' - implementation 'com.squareup.retrofit2:converter-gson:2.5.0' - implementation 'com.squareup.retrofit2:adapter-rxjava2:2.5.0' + implementation "com.squareup.retrofit2:retrofit:$retrofitVersion" + implementation "com.squareup.retrofit2:converter-gson:$retrofitVersion" + implementation "com.squareup.retrofit2:adapter-rxjava2:$retrofitVersion" implementation 'com.squareup.okhttp3:okhttp:3.14.2' implementation 'com.squareup.okhttp3:logging-interceptor:3.14.2' implementation 'org.conscrypt:conscrypt-android:2.1.0' @@ -133,20 +134,19 @@ dependencies { implementation "com.google.dagger:dagger-android:$daggerVersion" implementation "com.google.dagger:dagger-android-support:$daggerVersion" kapt "com.google.dagger:dagger-android-processor:$daggerVersion" - testImplementation 'org.robolectric:robolectric:4.2.1' - testImplementation 'org.mockito:mockito-inline:2.27.0' + testImplementation 'org.robolectric:robolectric:4.3' + testImplementation 'org.mockito:mockito-inline:2.28.2' testImplementation 'com.nhaarman.mockitokotlin2:mockito-kotlin:2.1.0' androidTestImplementation('androidx.test.espresso:espresso-core:3.1.1', { exclude group: 'com.android.support', module: 'support-annotations' }) androidTestImplementation 'android.arch.persistence.room:testing:1.1.1' - androidTestImplementation 'androidx.test.ext:junit:1.1.0' - testImplementation 'androidx.test.ext:junit:1.1.0' + androidTestImplementation 'androidx.test.ext:junit:1.1.1' + testImplementation 'androidx.test.ext:junit:1.1.1' debugImplementation 'im.dino:dbinspector:3.4.1@aar' - implementation 'io.reactivex.rxjava2:rxjava:2.2.8' + implementation 'io.reactivex.rxjava2:rxjava:2.2.9' implementation 'io.reactivex.rxjava2:rxandroid:2.1.1' implementation 'io.reactivex.rxjava2:rxkotlin:2.3.0' - implementation 'com.squareup.retrofit2:adapter-rxjava2:2.5.0' implementation 'com.uber.autodispose:autodispose-android-archcomponents:1.3.0' implementation 'com.uber.autodispose:autodispose:1.3.0' implementation 'androidx.paging:paging-runtime-ktx:2.1.0' diff --git a/app/src/main/java/com/keylesspalace/tusky/AccountActivity.kt b/app/src/main/java/com/keylesspalace/tusky/AccountActivity.kt index 00f02cb7f..36ff17d16 100644 --- a/app/src/main/java/com/keylesspalace/tusky/AccountActivity.kt +++ b/app/src/main/java/com/keylesspalace/tusky/AccountActivity.kt @@ -33,7 +33,6 @@ import androidx.appcompat.app.AlertDialog import androidx.core.app.ActivityOptionsCompat import androidx.core.content.ContextCompat import androidx.emoji.text.EmojiCompat -import androidx.fragment.app.Fragment import androidx.lifecycle.Observer import androidx.lifecycle.ViewModelProviders import androidx.recyclerview.widget.LinearLayoutManager @@ -53,18 +52,17 @@ import com.keylesspalace.tusky.interfaces.ReselectableFragment import com.keylesspalace.tusky.pager.AccountPagerAdapter import com.keylesspalace.tusky.util.* import com.keylesspalace.tusky.viewmodel.AccountViewModel -import dagger.android.AndroidInjector import dagger.android.DispatchingAndroidInjector -import dagger.android.support.HasSupportFragmentInjector +import dagger.android.HasAndroidInjector import kotlinx.android.synthetic.main.activity_account.* import kotlinx.android.synthetic.main.view_account_moved.* import java.text.NumberFormat import javax.inject.Inject -class AccountActivity : BottomSheetActivity(), ActionButtonActivity, HasSupportFragmentInjector, LinkListener { +class AccountActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidInjector, LinkListener { @Inject - lateinit var dispatchingAndroidInjector: DispatchingAndroidInjector + lateinit var dispatchingAndroidInjector: DispatchingAndroidInjector @Inject lateinit var viewModelFactory: ViewModelFactory @@ -711,9 +709,7 @@ class AccountActivity : BottomSheetActivity(), ActionButtonActivity, HasSupportF } else null } - override fun supportFragmentInjector(): AndroidInjector { - return dispatchingAndroidInjector - } + override fun androidInjector() = dispatchingAndroidInjector companion object { diff --git a/app/src/main/java/com/keylesspalace/tusky/AccountListActivity.kt b/app/src/main/java/com/keylesspalace/tusky/AccountListActivity.kt index a73092e3b..6cf3367eb 100644 --- a/app/src/main/java/com/keylesspalace/tusky/AccountListActivity.kt +++ b/app/src/main/java/com/keylesspalace/tusky/AccountListActivity.kt @@ -18,22 +18,17 @@ package com.keylesspalace.tusky import android.content.Context import android.content.Intent import android.os.Bundle -import androidx.fragment.app.Fragment import android.view.MenuItem - import com.keylesspalace.tusky.fragment.AccountListFragment - +import dagger.android.DispatchingAndroidInjector +import dagger.android.HasAndroidInjector +import kotlinx.android.synthetic.main.toolbar_basic.* import javax.inject.Inject -import dagger.android.AndroidInjector -import dagger.android.DispatchingAndroidInjector -import dagger.android.support.HasSupportFragmentInjector -import kotlinx.android.synthetic.main.toolbar_basic.* - -class AccountListActivity : BaseActivity(), HasSupportFragmentInjector { +class AccountListActivity : BaseActivity(), HasAndroidInjector { @Inject - lateinit var dispatchingAndroidInjector: DispatchingAndroidInjector + lateinit var dispatchingAndroidInjector: DispatchingAndroidInjector enum class Type { FOLLOWS, @@ -83,9 +78,7 @@ class AccountListActivity : BaseActivity(), HasSupportFragmentInjector { return super.onOptionsItemSelected(item) } - override fun supportFragmentInjector(): AndroidInjector? { - return dispatchingAndroidInjector - } + override fun androidInjector() = dispatchingAndroidInjector companion object { private const val EXTRA_TYPE = "type" diff --git a/app/src/main/java/com/keylesspalace/tusky/FavouritesActivity.java b/app/src/main/java/com/keylesspalace/tusky/FavouritesActivity.java index 643a221c5..0309d7417 100644 --- a/app/src/main/java/com/keylesspalace/tusky/FavouritesActivity.java +++ b/app/src/main/java/com/keylesspalace/tusky/FavouritesActivity.java @@ -16,14 +16,13 @@ package com.keylesspalace.tusky; import android.os.Bundle; +import android.view.MenuItem; import androidx.annotation.Nullable; -import androidx.fragment.app.Fragment; -import androidx.fragment.app.FragmentTransaction; import androidx.appcompat.app.ActionBar; import androidx.appcompat.widget.Toolbar; - -import android.view.MenuItem; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentTransaction; import com.keylesspalace.tusky.fragment.TimelineFragment; @@ -31,12 +30,12 @@ import javax.inject.Inject; import dagger.android.AndroidInjector; import dagger.android.DispatchingAndroidInjector; -import dagger.android.support.HasSupportFragmentInjector; +import dagger.android.HasAndroidInjector; -public class FavouritesActivity extends BottomSheetActivity implements HasSupportFragmentInjector { +public class FavouritesActivity extends BottomSheetActivity implements HasAndroidInjector { @Inject - public DispatchingAndroidInjector dispatchingAndroidInjector; + public DispatchingAndroidInjector dispatchingAndroidInjector; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { @@ -70,7 +69,7 @@ public class FavouritesActivity extends BottomSheetActivity implements HasSuppor } @Override - public AndroidInjector supportFragmentInjector() { + public AndroidInjector androidInjector() { return dispatchingAndroidInjector; } diff --git a/app/src/main/java/com/keylesspalace/tusky/ListsActivity.kt b/app/src/main/java/com/keylesspalace/tusky/ListsActivity.kt index b0eb29d9c..190b9e408 100644 --- a/app/src/main/java/com/keylesspalace/tusky/ListsActivity.kt +++ b/app/src/main/java/com/keylesspalace/tusky/ListsActivity.kt @@ -27,7 +27,6 @@ import android.view.ViewGroup import android.widget.* import androidx.annotation.StringRes import androidx.appcompat.app.AlertDialog -import androidx.fragment.app.Fragment import androidx.recyclerview.widget.* import androidx.recyclerview.widget.ListAdapter import at.connyduck.sparkbutton.helpers.Utils @@ -45,7 +44,7 @@ import com.mikepenz.iconics.IconicsDrawable import com.uber.autodispose.android.lifecycle.AndroidLifecycleScopeProvider.from import com.uber.autodispose.autoDisposable import dagger.android.DispatchingAndroidInjector -import dagger.android.support.HasSupportFragmentInjector +import dagger.android.HasAndroidInjector import io.reactivex.android.schedulers.AndroidSchedulers import kotlinx.android.synthetic.main.activity_lists.* import kotlinx.android.synthetic.main.toolbar_basic.* @@ -55,7 +54,7 @@ import javax.inject.Inject * Created by charlag on 1/4/18. */ -class ListsActivity : BaseActivity(), Injectable, HasSupportFragmentInjector { +class ListsActivity : BaseActivity(), Injectable, HasAndroidInjector { companion object { @JvmStatic @@ -68,7 +67,7 @@ class ListsActivity : BaseActivity(), Injectable, HasSupportFragmentInjector { lateinit var viewModelFactory: ViewModelFactory @Inject - lateinit var dispatchingAndroidInjector: DispatchingAndroidInjector + lateinit var dispatchingAndroidInjector: DispatchingAndroidInjector private lateinit var viewModel: ListsViewModel private val adapter = ListsAdapter() @@ -207,7 +206,7 @@ class ListsActivity : BaseActivity(), Injectable, HasSupportFragmentInjector { } } - override fun supportFragmentInjector() = dispatchingAndroidInjector + override fun androidInjector() = dispatchingAndroidInjector override fun onOptionsItemSelected(item: MenuItem): Boolean { if (item.itemId == android.R.id.home) { diff --git a/app/src/main/java/com/keylesspalace/tusky/MainActivity.java b/app/src/main/java/com/keylesspalace/tusky/MainActivity.java index 90b35d5ff..116570a7a 100644 --- a/app/src/main/java/com/keylesspalace/tusky/MainActivity.java +++ b/app/src/main/java/com/keylesspalace/tusky/MainActivity.java @@ -77,7 +77,7 @@ import javax.inject.Inject; import dagger.android.AndroidInjector; import dagger.android.DispatchingAndroidInjector; -import dagger.android.support.HasSupportFragmentInjector; +import dagger.android.HasAndroidInjector; import io.reactivex.android.schedulers.AndroidSchedulers; import static com.keylesspalace.tusky.util.MediaUtilsKt.deleteStaleCachedMedia; @@ -85,7 +85,7 @@ import static com.uber.autodispose.AutoDispose.autoDisposable; import static com.uber.autodispose.android.lifecycle.AndroidLifecycleScopeProvider.from; public final class MainActivity extends BottomSheetActivity implements ActionButtonActivity, - HasSupportFragmentInjector { + HasAndroidInjector { private static final String TAG = "MainActivity"; // logging tag private static final long DRAWER_ITEM_ADD_ACCOUNT = -13; @@ -102,7 +102,7 @@ public final class MainActivity extends BottomSheetActivity implements ActionBut public static final String STATUS_URL = "statusUrl"; @Inject - public DispatchingAndroidInjector fragmentInjector; + public DispatchingAndroidInjector androidInjector; @Inject public EventHub eventHub; @Inject @@ -624,7 +624,7 @@ public final class MainActivity extends BottomSheetActivity implements ActionBut } @Override - public AndroidInjector supportFragmentInjector() { - return fragmentInjector; + public AndroidInjector androidInjector() { + return androidInjector; } } \ No newline at end of file diff --git a/app/src/main/java/com/keylesspalace/tusky/ModalTimelineActivity.kt b/app/src/main/java/com/keylesspalace/tusky/ModalTimelineActivity.kt index cbb115d7a..e4655a5eb 100644 --- a/app/src/main/java/com/keylesspalace/tusky/ModalTimelineActivity.kt +++ b/app/src/main/java/com/keylesspalace/tusky/ModalTimelineActivity.kt @@ -3,18 +3,16 @@ package com.keylesspalace.tusky import android.content.Context import android.content.Intent import android.os.Bundle -import com.google.android.material.floatingactionbutton.FloatingActionButton -import androidx.fragment.app.Fragment import android.view.MenuItem +import com.google.android.material.floatingactionbutton.FloatingActionButton import com.keylesspalace.tusky.fragment.TimelineFragment import com.keylesspalace.tusky.interfaces.ActionButtonActivity -import dagger.android.AndroidInjector import dagger.android.DispatchingAndroidInjector -import dagger.android.support.HasSupportFragmentInjector +import dagger.android.HasAndroidInjector import kotlinx.android.synthetic.main.toolbar_basic.* import javax.inject.Inject -class ModalTimelineActivity : BottomSheetActivity(), ActionButtonActivity, HasSupportFragmentInjector { +class ModalTimelineActivity : BottomSheetActivity(), ActionButtonActivity, HasAndroidInjector { companion object { private const val ARG_KIND = "kind" @@ -32,7 +30,7 @@ class ModalTimelineActivity : BottomSheetActivity(), ActionButtonActivity, HasSu } @Inject - lateinit var dispatchingAndroidInjector: DispatchingAndroidInjector + lateinit var dispatchingAndroidInjector: DispatchingAndroidInjector override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -66,8 +64,6 @@ class ModalTimelineActivity : BottomSheetActivity(), ActionButtonActivity, HasSu return false } - override fun supportFragmentInjector(): AndroidInjector { - return dispatchingAndroidInjector - } + override fun androidInjector() = dispatchingAndroidInjector } diff --git a/app/src/main/java/com/keylesspalace/tusky/PreferencesActivity.kt b/app/src/main/java/com/keylesspalace/tusky/PreferencesActivity.kt index 39032b28a..d1e0c6a8f 100644 --- a/app/src/main/java/com/keylesspalace/tusky/PreferencesActivity.kt +++ b/app/src/main/java/com/keylesspalace/tusky/PreferencesActivity.kt @@ -28,21 +28,21 @@ import com.keylesspalace.tusky.appstore.PreferenceChangedEvent import com.keylesspalace.tusky.fragment.preference.* import com.keylesspalace.tusky.util.ThemeUtils import com.keylesspalace.tusky.util.getNonNullString -import dagger.android.AndroidInjector import dagger.android.DispatchingAndroidInjector -import dagger.android.support.HasSupportFragmentInjector import kotlinx.android.synthetic.main.toolbar_basic.* import java.lang.IllegalArgumentException import javax.inject.Inject import androidx.appcompat.app.AppCompatDelegate +import dagger.android.HasAndroidInjector -class PreferencesActivity : BaseActivity(), SharedPreferences.OnSharedPreferenceChangeListener, HasSupportFragmentInjector { +class PreferencesActivity : BaseActivity(), SharedPreferences.OnSharedPreferenceChangeListener, + HasAndroidInjector { @Inject lateinit var eventHub: EventHub @Inject - lateinit var fragmentInjector: DispatchingAndroidInjector + lateinit var androidInjector: DispatchingAndroidInjector private var restartActivitiesOnExit: Boolean = false @@ -173,9 +173,7 @@ class PreferencesActivity : BaseActivity(), SharedPreferences.OnSharedPreference } } - override fun supportFragmentInjector(): AndroidInjector { - return fragmentInjector - } + override fun androidInjector() = androidInjector companion object { diff --git a/app/src/main/java/com/keylesspalace/tusky/SearchActivity.java b/app/src/main/java/com/keylesspalace/tusky/SearchActivity.java index eac55bdab..5fc5a7cdd 100644 --- a/app/src/main/java/com/keylesspalace/tusky/SearchActivity.java +++ b/app/src/main/java/com/keylesspalace/tusky/SearchActivity.java @@ -20,14 +20,14 @@ import android.app.SearchableInfo; import android.content.Context; import android.content.Intent; import android.os.Bundle; +import android.view.Menu; +import android.view.MenuItem; + import androidx.annotation.Nullable; -import androidx.fragment.app.Fragment; -import androidx.fragment.app.FragmentTransaction; import androidx.appcompat.app.ActionBar; import androidx.appcompat.widget.SearchView; import androidx.appcompat.widget.Toolbar; -import android.view.Menu; -import android.view.MenuItem; +import androidx.fragment.app.FragmentTransaction; import com.keylesspalace.tusky.fragment.SearchFragment; @@ -35,13 +35,13 @@ import javax.inject.Inject; import dagger.android.AndroidInjector; import dagger.android.DispatchingAndroidInjector; -import dagger.android.support.HasSupportFragmentInjector; +import dagger.android.HasAndroidInjector; public class SearchActivity extends BottomSheetActivity implements SearchView.OnQueryTextListener, - HasSupportFragmentInjector { + HasAndroidInjector { @Inject - public DispatchingAndroidInjector fragmentInjector; + public DispatchingAndroidInjector androidInjector; private String currentQuery; @@ -136,8 +136,8 @@ public class SearchActivity extends BottomSheetActivity implements SearchView.On } @Override - public AndroidInjector supportFragmentInjector() { - return fragmentInjector; + public AndroidInjector androidInjector() { + return androidInjector; } } diff --git a/app/src/main/java/com/keylesspalace/tusky/TuskyApplication.java b/app/src/main/java/com/keylesspalace/tusky/TuskyApplication.java index 9565fd15c..99ab905a5 100644 --- a/app/src/main/java/com/keylesspalace/tusky/TuskyApplication.java +++ b/app/src/main/java/com/keylesspalace/tusky/TuskyApplication.java @@ -15,15 +15,13 @@ package com.keylesspalace.tusky; -import android.app.Activity; import android.app.Application; -import android.app.Service; -import androidx.room.Room; -import android.content.BroadcastReceiver; import android.content.Context; import android.content.res.Configuration; import android.preference.PreferenceManager; + import androidx.emoji.text.EmojiCompat; +import androidx.room.Room; import com.evernote.android.job.JobManager; import com.keylesspalace.tusky.db.AccountManager; @@ -41,17 +39,12 @@ import javax.inject.Inject; import dagger.android.AndroidInjector; import dagger.android.DispatchingAndroidInjector; -import dagger.android.HasActivityInjector; -import dagger.android.HasBroadcastReceiverInjector; -import dagger.android.HasServiceInjector; +import dagger.android.HasAndroidInjector; -public class TuskyApplication extends Application implements HasActivityInjector, HasServiceInjector, HasBroadcastReceiverInjector { +public class TuskyApplication extends Application implements HasAndroidInjector { @Inject - DispatchingAndroidInjector dispatchingAndroidInjector; - @Inject - DispatchingAndroidInjector dispatchingServiceInjector; - @Inject - DispatchingAndroidInjector dispatchingBroadcastReceiverInjector; + DispatchingAndroidInjector androidInjector; + @Inject NotificationPullJobCreator notificationPullJobCreator; @@ -142,18 +135,8 @@ public class TuskyApplication extends Application implements HasActivityInjector } @Override - public AndroidInjector activityInjector() { - return dispatchingAndroidInjector; - } - - @Override - public AndroidInjector serviceInjector() { - return dispatchingServiceInjector; - } - - @Override - public AndroidInjector broadcastReceiverInjector() { - return dispatchingBroadcastReceiverInjector; + public AndroidInjector androidInjector() { + return androidInjector; } public interface ServiceLocator { diff --git a/app/src/main/java/com/keylesspalace/tusky/ViewTagActivity.java b/app/src/main/java/com/keylesspalace/tusky/ViewTagActivity.java index 663dbc84f..f1985ec54 100644 --- a/app/src/main/java/com/keylesspalace/tusky/ViewTagActivity.java +++ b/app/src/main/java/com/keylesspalace/tusky/ViewTagActivity.java @@ -18,14 +18,13 @@ package com.keylesspalace.tusky; import android.content.Context; import android.content.Intent; import android.os.Bundle; +import android.view.MenuItem; import androidx.annotation.Nullable; -import androidx.fragment.app.Fragment; -import androidx.fragment.app.FragmentTransaction; import androidx.appcompat.app.ActionBar; import androidx.appcompat.widget.Toolbar; - -import android.view.MenuItem; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentTransaction; import com.keylesspalace.tusky.fragment.TimelineFragment; @@ -33,13 +32,14 @@ import javax.inject.Inject; import dagger.android.AndroidInjector; import dagger.android.DispatchingAndroidInjector; -import dagger.android.support.HasSupportFragmentInjector; +import dagger.android.HasAndroidInjector; + +public class ViewTagActivity extends BottomSheetActivity implements HasAndroidInjector { -public class ViewTagActivity extends BottomSheetActivity implements HasSupportFragmentInjector { private static final String HASHTAG = "hashtag"; @Inject - public DispatchingAndroidInjector dispatchingAndroidInjector; + public DispatchingAndroidInjector dispatchingAndroidInjector; public static Intent getIntent(Context context, String tag){ Intent intent = new Intent(context,ViewTagActivity.class); @@ -82,7 +82,7 @@ public class ViewTagActivity extends BottomSheetActivity implements HasSupportFr } @Override - public AndroidInjector supportFragmentInjector() { + public AndroidInjector androidInjector() { return dispatchingAndroidInjector; } diff --git a/app/src/main/java/com/keylesspalace/tusky/ViewThreadActivity.java b/app/src/main/java/com/keylesspalace/tusky/ViewThreadActivity.java index 171463b3d..e2ae63d17 100644 --- a/app/src/main/java/com/keylesspalace/tusky/ViewThreadActivity.java +++ b/app/src/main/java/com/keylesspalace/tusky/ViewThreadActivity.java @@ -19,7 +19,6 @@ import android.content.Context; import android.content.Intent; import android.os.Bundle; import androidx.annotation.Nullable; -import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentTransaction; import androidx.appcompat.app.ActionBar; import androidx.appcompat.widget.Toolbar; @@ -33,9 +32,9 @@ import javax.inject.Inject; import dagger.android.AndroidInjector; import dagger.android.DispatchingAndroidInjector; -import dagger.android.support.HasSupportFragmentInjector; +import dagger.android.HasAndroidInjector; -public class ViewThreadActivity extends BottomSheetActivity implements HasSupportFragmentInjector { +public class ViewThreadActivity extends BottomSheetActivity implements HasAndroidInjector { public static final int REVEAL_BUTTON_HIDDEN = 1; public static final int REVEAL_BUTTON_REVEAL = 2; @@ -55,7 +54,7 @@ public class ViewThreadActivity extends BottomSheetActivity implements HasSuppor private int revealButtonState = REVEAL_BUTTON_HIDDEN; @Inject - public DispatchingAndroidInjector dispatchingAndroidInjector; + public DispatchingAndroidInjector dispatchingAndroidInjector; private ViewThreadFragment fragment; @@ -128,7 +127,7 @@ public class ViewThreadActivity extends BottomSheetActivity implements HasSuppor } @Override - public AndroidInjector supportFragmentInjector() { + public AndroidInjector androidInjector() { return dispatchingAndroidInjector; } diff --git a/app/src/main/java/com/keylesspalace/tusky/di/AppInjector.kt b/app/src/main/java/com/keylesspalace/tusky/di/AppInjector.kt index 495e8f30d..bd06bfc1e 100644 --- a/app/src/main/java/com/keylesspalace/tusky/di/AppInjector.kt +++ b/app/src/main/java/com/keylesspalace/tusky/di/AppInjector.kt @@ -24,8 +24,8 @@ import androidx.fragment.app.FragmentActivity import androidx.fragment.app.FragmentManager import com.keylesspalace.tusky.TuskyApplication import dagger.android.AndroidInjection +import dagger.android.HasAndroidInjector import dagger.android.support.AndroidSupportInjection -import dagger.android.support.HasSupportFragmentInjector /** * Created by charlag on 3/24/18. @@ -63,7 +63,7 @@ object AppInjector { } private fun handleActivity(activity: Activity) { - if (activity is HasSupportFragmentInjector || activity is Injectable) { + if (activity is HasAndroidInjector || activity is Injectable) { AndroidInjection.inject(activity) } if (activity is FragmentActivity) {