Cleanup
This commit is contained in:
parent
1a1b3342c0
commit
766bf0539d
@ -10,7 +10,6 @@ import android.view.MenuInflater
|
|||||||
import android.view.MenuItem
|
import android.view.MenuItem
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.view.WindowInsets
|
|
||||||
import android.view.WindowManager
|
import android.view.WindowManager
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.appcompat.view.ActionMode
|
import androidx.appcompat.view.ActionMode
|
||||||
@ -796,15 +795,3 @@ class LibraryController(
|
|||||||
const val REQUEST_IMAGE_OPEN = 101
|
const val REQUEST_IMAGE_OPEN = 101
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
object HeightTopWindowInsetsListener : View.OnApplyWindowInsetsListener {
|
|
||||||
override fun onApplyWindowInsets(v: View, insets: WindowInsets): WindowInsets {
|
|
||||||
val topInset = insets.systemWindowInsetTop
|
|
||||||
v.setPadding(0, topInset, 0, 0)
|
|
||||||
if (v.layoutParams.height != topInset) {
|
|
||||||
v.layoutParams.height = topInset
|
|
||||||
v.requestLayout()
|
|
||||||
}
|
|
||||||
return insets
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -5,7 +5,6 @@ import android.animation.AnimatorListenerAdapter
|
|||||||
import android.app.Activity
|
import android.app.Activity
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.util.Log
|
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.Menu
|
import android.view.Menu
|
||||||
import android.view.MenuInflater
|
import android.view.MenuInflater
|
||||||
@ -179,11 +178,9 @@ class MangaAllInOneController :
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun createPresenter(): MangaAllInOnePresenter {
|
override fun createPresenter(): MangaAllInOnePresenter {
|
||||||
Log.d("Adapter", "Tester8")
|
|
||||||
return MangaAllInOnePresenter(
|
return MangaAllInOnePresenter(
|
||||||
this, manga!!, source!!, smartSearchConfig
|
this, manga!!, source!!, smartSearchConfig
|
||||||
)
|
)
|
||||||
Log.d("Adapter", "Tester9")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun inflateView(inflater: LayoutInflater, container: ViewGroup): View {
|
override fun inflateView(inflater: LayoutInflater, container: ViewGroup): View {
|
||||||
@ -201,8 +198,6 @@ class MangaAllInOneController :
|
|||||||
.onEach { fetchMangaFromSource(manualFetch = true) }
|
.onEach { fetchMangaFromSource(manualFetch = true) }
|
||||||
.launchIn(scope)
|
.launchIn(scope)
|
||||||
|
|
||||||
Log.d("Controller", "Tester1")
|
|
||||||
|
|
||||||
// Init RecyclerView and adapter
|
// Init RecyclerView and adapter
|
||||||
adapter = MangaAllInOneAdapter(this, view.context)
|
adapter = MangaAllInOneAdapter(this, view.context)
|
||||||
|
|
||||||
@ -211,7 +206,6 @@ class MangaAllInOneController :
|
|||||||
binding.recycler.addItemDecoration(DividerItemDecoration(view.context, DividerItemDecoration.VERTICAL))
|
binding.recycler.addItemDecoration(DividerItemDecoration(view.context, DividerItemDecoration.VERTICAL))
|
||||||
binding.recycler.setHasFixedSize(true)
|
binding.recycler.setHasFixedSize(true)
|
||||||
adapter?.fastScroller = binding.fastScroller
|
adapter?.fastScroller = binding.fastScroller
|
||||||
Log.d("Adapter", "Tester2")
|
|
||||||
|
|
||||||
binding.fab.clicks()
|
binding.fab.clicks()
|
||||||
.onEach {
|
.onEach {
|
||||||
@ -239,22 +233,17 @@ class MangaAllInOneController :
|
|||||||
|
|
||||||
binding.actionToolbar.offsetAppbarHeight(activity!!)
|
binding.actionToolbar.offsetAppbarHeight(activity!!)
|
||||||
binding.fab.offsetAppbarHeight(activity!!)
|
binding.fab.offsetAppbarHeight(activity!!)
|
||||||
Log.d("Adapter", "Tester3")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getHeader(): MangaAllInOneHolder? {
|
private fun getHeader(): MangaAllInOneHolder? {
|
||||||
Log.d("Adapter", "Tester4")
|
|
||||||
return binding.recycler.findViewHolderForAdapterPosition(0) as? MangaAllInOneHolder
|
return binding.recycler.findViewHolderForAdapterPosition(0) as? MangaAllInOneHolder
|
||||||
Log.d("Adapter", "Tester5")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun addMangaHeader() {
|
private fun addMangaHeader() {
|
||||||
Log.d("Adapter", "Tester6")
|
|
||||||
if (adapter?.scrollableHeaders?.isEmpty() == true) {
|
if (adapter?.scrollableHeaders?.isEmpty() == true) {
|
||||||
adapter?.removeAllScrollableHeaders()
|
adapter?.removeAllScrollableHeaders()
|
||||||
adapter?.addScrollableHeader(presenter.headerItem)
|
adapter?.addScrollableHeader(presenter.headerItem)
|
||||||
}
|
}
|
||||||
Log.d("Adapter", "Tester7")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// EXH -->
|
// EXH -->
|
||||||
@ -340,16 +329,12 @@ class MangaAllInOneController :
|
|||||||
override fun onNextManga(manga: Manga, source: Source, chapters: List<MangaAllInOneChapterItem>, lastUpdateDate: Date, chapterCount: Float) {
|
override fun onNextManga(manga: Manga, source: Source, chapters: List<MangaAllInOneChapterItem>, lastUpdateDate: Date, chapterCount: Float) {
|
||||||
if (manga.initialized) {
|
if (manga.initialized) {
|
||||||
// Update view.
|
// Update view.
|
||||||
Log.d("Controller", "Tester1")
|
|
||||||
setMangaInfo(manga, source, chapters, lastUpdateDate, chapterCount)
|
setMangaInfo(manga, source, chapters, lastUpdateDate, chapterCount)
|
||||||
Log.d("Controller", "Tester2")
|
|
||||||
if (fromSource && !presenter.hasRequested && chapters.isNullOrEmpty()) {
|
if (fromSource && !presenter.hasRequested && chapters.isNullOrEmpty()) {
|
||||||
Log.d("Controller", "Tester3")
|
|
||||||
fetchMangaFromSource(fetchManga = false)
|
fetchMangaFromSource(fetchManga = false)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Initialize manga.
|
// Initialize manga.
|
||||||
Log.d("Controller", "Tester4")
|
|
||||||
fetchMangaFromSource()
|
fetchMangaFromSource()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user