From 6ce34bd92b929af71f0e494ab913d03d45dcff1c Mon Sep 17 00:00:00 2001 From: Justin Biggs Date: Sat, 25 Jan 2020 08:47:24 -0600 Subject: [PATCH] 1581 revert two unnecessary deletions. Update TestComponent with modules --- .../org/kiwix/kiwixmobile/core/di/components/TestComponent.kt | 4 ++++ .../core/search/viewmodel/effects/ShowDeleteSearchDialog.kt | 2 ++ .../kiwix/kiwixmobile/core/settings/CoreSettingsActivity.java | 4 ---- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/src/androidTest/java/org/kiwix/kiwixmobile/core/di/components/TestComponent.kt b/app/src/androidTest/java/org/kiwix/kiwixmobile/core/di/components/TestComponent.kt index e297e8ac7..64f134931 100644 --- a/app/src/androidTest/java/org/kiwix/kiwixmobile/core/di/components/TestComponent.kt +++ b/app/src/androidTest/java/org/kiwix/kiwixmobile/core/di/components/TestComponent.kt @@ -22,12 +22,14 @@ import dagger.BindsInstance import dagger.Component import org.kiwix.kiwixmobile.NetworkTest import org.kiwix.kiwixmobile.ZimTest +import org.kiwix.kiwixmobile.core.bookmark.BookmarksModule import org.kiwix.kiwixmobile.core.data.DataModule import org.kiwix.kiwixmobile.core.di.modules.ApplicationModule import org.kiwix.kiwixmobile.core.di.modules.CoreViewModelModule import org.kiwix.kiwixmobile.core.di.modules.JNIModule import org.kiwix.kiwixmobile.core.di.modules.SearchModule import org.kiwix.kiwixmobile.core.di.modules.TestNetworkModule +import org.kiwix.kiwixmobile.core.history.HistoryModule import javax.inject.Singleton /** @@ -37,6 +39,8 @@ import javax.inject.Singleton @Singleton @Component( modules = [ + BookmarksModule::class, + HistoryModule::class, ApplicationModule::class, TestNetworkModule::class, JNIModule::class, diff --git a/core/src/main/java/org/kiwix/kiwixmobile/core/search/viewmodel/effects/ShowDeleteSearchDialog.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/search/viewmodel/effects/ShowDeleteSearchDialog.kt index 9b4b7534f..6076a1021 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/core/search/viewmodel/effects/ShowDeleteSearchDialog.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/search/viewmodel/effects/ShowDeleteSearchDialog.kt @@ -21,6 +21,7 @@ package org.kiwix.kiwixmobile.core.search.viewmodel.effects import androidx.appcompat.app.AppCompatActivity import io.reactivex.processors.PublishProcessor import org.kiwix.kiwixmobile.core.base.SideEffect +import org.kiwix.kiwixmobile.core.search.SearchActivity import org.kiwix.kiwixmobile.core.search.adapter.SearchListItem import org.kiwix.kiwixmobile.core.search.viewmodel.Action import org.kiwix.kiwixmobile.core.utils.DialogShower @@ -35,6 +36,7 @@ data class ShowDeleteSearchDialog( @Inject lateinit var dialogShower: DialogShower override fun invokeWith(activity: AppCompatActivity) { + (activity as SearchActivity).activityComponent.inject(this) dialogShower.show(DeleteSearch, { actions.offer(Action.ConfirmedDelete(searchListItem)) }) } } diff --git a/core/src/main/java/org/kiwix/kiwixmobile/core/settings/CoreSettingsActivity.java b/core/src/main/java/org/kiwix/kiwixmobile/core/settings/CoreSettingsActivity.java index 9a11cc096..0f6410ee5 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/core/settings/CoreSettingsActivity.java +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/settings/CoreSettingsActivity.java @@ -72,8 +72,4 @@ public abstract class CoreSettingsActivity extends BaseActivity { toolbar.setNavigationOnClickListener(v -> onBackPressed()); } - - @Override protected void injection(CoreComponent coreComponent) { - coreComponent.inject(this); - } }