mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-08-03 18:56:44 -04:00
Deleted dialog module
This commit is contained in:
parent
c6a7c6a5f9
commit
5baba3d49f
@ -25,6 +25,7 @@ import org.kiwix.kiwixmobile.core.bookmark.BookmarksActivity
|
|||||||
import org.kiwix.kiwixmobile.core.di.ActivityScope
|
import org.kiwix.kiwixmobile.core.di.ActivityScope
|
||||||
import org.kiwix.kiwixmobile.core.di.modules.ActivityModule
|
import org.kiwix.kiwixmobile.core.di.modules.ActivityModule
|
||||||
import org.kiwix.kiwixmobile.core.history.HistoryActivity
|
import org.kiwix.kiwixmobile.core.history.HistoryActivity
|
||||||
|
import org.kiwix.kiwixmobile.core.main.AddNoteDialog
|
||||||
import org.kiwix.kiwixmobile.core.search.SearchActivity
|
import org.kiwix.kiwixmobile.core.search.SearchActivity
|
||||||
import org.kiwix.kiwixmobile.core.search.viewmodel.effects.ShowDeleteSearchDialog
|
import org.kiwix.kiwixmobile.core.search.viewmodel.effects.ShowDeleteSearchDialog
|
||||||
import org.kiwix.kiwixmobile.core.settings.CorePrefsFragment
|
import org.kiwix.kiwixmobile.core.settings.CorePrefsFragment
|
||||||
@ -37,6 +38,7 @@ interface CoreActivityComponent {
|
|||||||
fun inject(corePrefsFragment: CorePrefsFragment)
|
fun inject(corePrefsFragment: CorePrefsFragment)
|
||||||
fun inject(historyActivity: HistoryActivity)
|
fun inject(historyActivity: HistoryActivity)
|
||||||
fun inject(bookmarksActivity: BookmarksActivity)
|
fun inject(bookmarksActivity: BookmarksActivity)
|
||||||
|
fun inject(addNoteDialog: AddNoteDialog)
|
||||||
|
|
||||||
@Subcomponent.Builder
|
@Subcomponent.Builder
|
||||||
interface Builder {
|
interface Builder {
|
||||||
|
@ -39,7 +39,6 @@ import org.kiwix.kiwixmobile.core.data.local.dao.BookmarksDao
|
|||||||
import org.kiwix.kiwixmobile.core.data.remote.KiwixService
|
import org.kiwix.kiwixmobile.core.data.remote.KiwixService
|
||||||
import org.kiwix.kiwixmobile.core.di.modules.ApplicationModule
|
import org.kiwix.kiwixmobile.core.di.modules.ApplicationModule
|
||||||
import org.kiwix.kiwixmobile.core.di.modules.CoreViewModelModule
|
import org.kiwix.kiwixmobile.core.di.modules.CoreViewModelModule
|
||||||
import org.kiwix.kiwixmobile.core.di.modules.DialogModule
|
|
||||||
import org.kiwix.kiwixmobile.core.di.modules.JNIModule
|
import org.kiwix.kiwixmobile.core.di.modules.JNIModule
|
||||||
import org.kiwix.kiwixmobile.core.di.modules.NetworkModule
|
import org.kiwix.kiwixmobile.core.di.modules.NetworkModule
|
||||||
import org.kiwix.kiwixmobile.core.di.modules.SearchModule
|
import org.kiwix.kiwixmobile.core.di.modules.SearchModule
|
||||||
@ -47,7 +46,6 @@ import org.kiwix.kiwixmobile.core.downloader.Downloader
|
|||||||
import org.kiwix.kiwixmobile.core.error.ErrorActivity
|
import org.kiwix.kiwixmobile.core.error.ErrorActivity
|
||||||
import org.kiwix.kiwixmobile.core.help.HelpActivity
|
import org.kiwix.kiwixmobile.core.help.HelpActivity
|
||||||
import org.kiwix.kiwixmobile.core.history.HistoryModule
|
import org.kiwix.kiwixmobile.core.history.HistoryModule
|
||||||
import org.kiwix.kiwixmobile.core.main.AddNoteDialog
|
|
||||||
import org.kiwix.kiwixmobile.core.main.KiwixWebView
|
import org.kiwix.kiwixmobile.core.main.KiwixWebView
|
||||||
import org.kiwix.kiwixmobile.core.reader.ZimContentProvider
|
import org.kiwix.kiwixmobile.core.reader.ZimContentProvider
|
||||||
import org.kiwix.kiwixmobile.core.reader.ZimFileReader
|
import org.kiwix.kiwixmobile.core.reader.ZimFileReader
|
||||||
@ -68,8 +66,7 @@ import javax.inject.Singleton
|
|||||||
JNIModule::class,
|
JNIModule::class,
|
||||||
DataModule::class,
|
DataModule::class,
|
||||||
CoreViewModelModule::class,
|
CoreViewModelModule::class,
|
||||||
SearchModule::class,
|
SearchModule::class
|
||||||
DialogModule::class
|
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
interface CoreComponent {
|
interface CoreComponent {
|
||||||
@ -107,7 +104,6 @@ interface CoreComponent {
|
|||||||
fun inject(zimContentProvider: ZimContentProvider)
|
fun inject(zimContentProvider: ZimContentProvider)
|
||||||
fun inject(kiwixWebView: KiwixWebView)
|
fun inject(kiwixWebView: KiwixWebView)
|
||||||
fun inject(storageSelectDialog: StorageSelectDialog)
|
fun inject(storageSelectDialog: StorageSelectDialog)
|
||||||
fun inject(addNoteDialog: AddNoteDialog)
|
|
||||||
|
|
||||||
fun inject(errorActivity: ErrorActivity)
|
fun inject(errorActivity: ErrorActivity)
|
||||||
fun inject(searchActivity: SearchActivity)
|
fun inject(searchActivity: SearchActivity)
|
||||||
|
@ -1,38 +0,0 @@
|
|||||||
/*
|
|
||||||
* Kiwix Android
|
|
||||||
* Copyright (c) 2019 Kiwix <android.kiwix.org>
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.kiwix.kiwixmobile.core.di.modules
|
|
||||||
|
|
||||||
import dagger.Binds
|
|
||||||
import dagger.Module
|
|
||||||
import org.kiwix.kiwixmobile.core.di.ActivityScope
|
|
||||||
import org.kiwix.kiwixmobile.core.main.MainContract
|
|
||||||
import org.kiwix.kiwixmobile.core.main.MainPresenter
|
|
||||||
import org.kiwix.kiwixmobile.core.utils.AlertDialogShower
|
|
||||||
import org.kiwix.kiwixmobile.core.utils.DialogShower
|
|
||||||
|
|
||||||
@Module
|
|
||||||
abstract class DialogModule {
|
|
||||||
|
|
||||||
@Binds
|
|
||||||
@ActivityScope
|
|
||||||
abstract fun bindDialogShower(alertDialogShower: AlertDialogShower): DialogShower
|
|
||||||
|
|
||||||
@Binds
|
|
||||||
internal abstract fun bindMainPresenter(mainPresenter: MainPresenter): MainContract.Presenter
|
|
||||||
}
|
|
@ -56,6 +56,7 @@ import kotlin.Unit;
|
|||||||
import org.kiwix.kiwixmobile.core.CoreApp;
|
import org.kiwix.kiwixmobile.core.CoreApp;
|
||||||
import org.kiwix.kiwixmobile.core.R;
|
import org.kiwix.kiwixmobile.core.R;
|
||||||
import org.kiwix.kiwixmobile.core.R2;
|
import org.kiwix.kiwixmobile.core.R2;
|
||||||
|
import org.kiwix.kiwixmobile.core.di.components.CoreComponent;
|
||||||
import org.kiwix.kiwixmobile.core.reader.ZimReaderContainer;
|
import org.kiwix.kiwixmobile.core.reader.ZimReaderContainer;
|
||||||
import org.kiwix.kiwixmobile.core.utils.AlertDialogShower;
|
import org.kiwix.kiwixmobile.core.utils.AlertDialogShower;
|
||||||
import org.kiwix.kiwixmobile.core.utils.KiwixDialog;
|
import org.kiwix.kiwixmobile.core.utils.KiwixDialog;
|
||||||
@ -102,7 +103,7 @@ public class AddNoteDialog extends DialogFragment {
|
|||||||
@Override
|
@Override
|
||||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
CoreApp.getCoreComponent().inject(this);
|
injection(CoreApp.getCoreComponent());
|
||||||
|
|
||||||
// Returns name of the form ".../Kiwix/granbluefantasy_en_all_all_nopic_2018-10.zim"
|
// Returns name of the form ".../Kiwix/granbluefantasy_en_all_all_nopic_2018-10.zim"
|
||||||
zimFileName = zimReaderContainer.getZimCanonicalPath();
|
zimFileName = zimReaderContainer.getZimCanonicalPath();
|
||||||
@ -245,6 +246,10 @@ public class AddNoteDialog extends DialogFragment {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void injection(@NonNull CoreComponent coreComponent) {
|
||||||
|
coreComponent.activityComponentBuilder().activity(getActivity()).build().inject(this);
|
||||||
|
}
|
||||||
|
|
||||||
private void disableMenuItems() {
|
private void disableMenuItems() {
|
||||||
if (toolbar.getMenu() != null) {
|
if (toolbar.getMenu() != null) {
|
||||||
MenuItem saveItem = toolbar.getMenu().findItem(R.id.save_note);
|
MenuItem saveItem = toolbar.getMenu().findItem(R.id.save_note);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user