Cleanup of old library controller

This commit is contained in:
Jay 2020-03-16 02:00:29 -07:00
parent 8f884bf222
commit ccbb806507
4 changed files with 10 additions and 25 deletions

View File

@ -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)
}

View File

@ -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)

View File

@ -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 {

View File

@ -17,11 +17,6 @@
android:layout_height="match_parent" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:id="@+id/snackbar_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<eu.kanade.tachiyomi.widget.EmptyView
android:id="@+id/empty_view"
android:layout_width="wrap_content"
@ -42,19 +37,6 @@
<!-- Adding bottom sheet after main content -->
<include layout="@layout/filter_bottom_sheet"/>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab"
style="@style/Theme.Widget.FABFixed"
android:layout_gravity="center"
android:clickable="false"
android:focusable="false"
android:scaleX="0"
android:scaleY="0"
android:visibility="gone"
app:layout_anchor="@id/bottom_sheet"
app:layout_anchorGravity="end|top"
app:srcCompat="@drawable/ic_file_download_white_24dp" />
<View
android:id="@+id/shadow2"
android:layout_width="match_parent"