From ccbb8065079d9e297d221cf4e7979dd7b66f4230 Mon Sep 17 00:00:00 2001 From: Jay Date: Mon, 16 Mar 2020 02:00:29 -0700 Subject: [PATCH] Cleanup of old library controller --- .../ui/library/LibraryCategoryView.kt | 8 +++++--- .../tachiyomi/ui/library/LibraryController.kt | 3 ++- .../kanade/tachiyomi/ui/main/MainActivity.kt | 6 +++--- app/src/main/res/layout/library_controller.xml | 18 ------------------ 4 files changed, 10 insertions(+), 25 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCategoryView.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCategoryView.kt index bb78f33178..27f24a7e08 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCategoryView.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCategoryView.kt @@ -24,8 +24,8 @@ import eu.kanade.tachiyomi.util.view.inflate import eu.kanade.tachiyomi.util.view.snack import eu.kanade.tachiyomi.util.view.updatePaddingRelative import eu.kanade.tachiyomi.widget.AutofitRecyclerView +import kotlinx.android.synthetic.main.filter_bottom_sheet.* import kotlinx.android.synthetic.main.library_category.view.* -import kotlinx.android.synthetic.main.library_controller.* import kotlinx.coroutines.delay import rx.subscriptions.CompositeSubscription import uy.kohesive.injekt.injectLazy @@ -116,13 +116,15 @@ class LibraryCategoryView @JvmOverloads constructor(context: Context, attrs: Att swipe_refresh.setOnRefreshListener { val inQueue = LibraryUpdateService.categoryInQueue(category.id) controller.snack?.dismiss() - controller.snack = controller.snackbar_layout.snack( + controller.snack = controller.view?.snack( resources.getString( when { inQueue -> R.string.category_already_in_queue LibraryUpdateService.isRunning() -> R.string.adding_category_to_queue else -> R.string.updating_category_x - }, category.name)) + }, category.name)) { + anchorView = controller.bottom_sheet + } if (!inQueue) LibraryUpdateService.start(context, category) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt index 475b6cc8f2..718ab1ba8e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt @@ -651,9 +651,10 @@ open class LibraryController( presenter.removeMangaFromLibrary(mangas) destroyActionModeIfNeeded() snack?.dismiss() - snack = snackbar_layout?.snack( + snack = view?.snack( activity?.getString(R.string.manga_removed_library) ?: "", Snackbar.LENGTH_INDEFINITE ) { + anchorView = bottom_sheet var undoing = false setAction(R.string.action_undo) { presenter.addMangas(mangas) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt index 62581cbf25..af72d12b5d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt @@ -63,6 +63,9 @@ import eu.kanade.tachiyomi.util.view.gone import eu.kanade.tachiyomi.util.view.updateLayoutParams import eu.kanade.tachiyomi.util.view.updatePadding import eu.kanade.tachiyomi.util.view.visible +import java.util.Date +import java.util.concurrent.TimeUnit +import kotlin.math.abs import kotlinx.android.synthetic.main.main_activity.* import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.GlobalScope @@ -70,9 +73,6 @@ import kotlinx.coroutines.delay import kotlinx.coroutines.launch import timber.log.Timber import uy.kohesive.injekt.injectLazy -import java.util.Date -import java.util.concurrent.TimeUnit -import kotlin.math.abs open class MainActivity : BaseActivity(), DownloadServiceListener { diff --git a/app/src/main/res/layout/library_controller.xml b/app/src/main/res/layout/library_controller.xml index 9bbef84f52..cf49dc4c2a 100644 --- a/app/src/main/res/layout/library_controller.xml +++ b/app/src/main/res/layout/library_controller.xml @@ -17,11 +17,6 @@ android:layout_height="match_parent" /> - - - -