mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-09 19:55:11 +01:00
Fixing imports
This commit is contained in:
parent
b3842cd9ea
commit
98972e76c9
@ -120,6 +120,7 @@ class DownloadManager(val context: Context) {
|
||||
|
||||
fun isPaused() = downloader.isPaused()
|
||||
|
||||
fun hasQueue() = downloader.queue.isNotEmpty()
|
||||
|
||||
/**
|
||||
* Tells the downloader to enqueue the given list of chapters.
|
||||
|
@ -1,9 +1,9 @@
|
||||
package eu.kanade.tachiyomi.ui.library
|
||||
|
||||
import android.app.DownloadManager
|
||||
import android.content.Context
|
||||
import android.content.res.Configuration
|
||||
import android.graphics.Color
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.Menu
|
||||
@ -12,7 +12,6 @@ import android.view.MenuItem
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.WindowInsets
|
||||
import android.view.WindowManager
|
||||
import android.view.inputmethod.InputMethodManager
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.appcompat.view.ActionMode
|
||||
@ -51,8 +50,7 @@ import eu.kanade.tachiyomi.ui.migration.MigrationInterface
|
||||
import eu.kanade.tachiyomi.ui.migration.manga.design.PreMigrationController
|
||||
import eu.kanade.tachiyomi.ui.migration.manga.process.MigrationListController
|
||||
import eu.kanade.tachiyomi.ui.migration.manga.process.MigrationProcedureConfig
|
||||
import eu.kanade.tachiyomi.ui.setting.SettingsAdvancedController
|
||||
import eu.kanade.tachiyomi.util.view.doOnApplyWindowInsets
|
||||
import eu.kanade.tachiyomi.util.system.getResourceColor
|
||||
import eu.kanade.tachiyomi.util.view.inflate
|
||||
import eu.kanade.tachiyomi.util.view.marginBottom
|
||||
import eu.kanade.tachiyomi.util.view.marginTop
|
||||
@ -440,9 +438,10 @@ class LibraryController(
|
||||
val searchView = searchItem.actionView as SearchView
|
||||
searchView.queryHint = resources?.getString(R.string.search_hint)
|
||||
|
||||
menu.findItem(R.id.action_downloads).isVisible = MainActivity.bottomNav
|
||||
menu.findItem(R.id.action_downloads).isVisible = MainActivity.bottomNav &&
|
||||
presenter.hasPendingDownloads()
|
||||
searchItem.collapseActionView()
|
||||
if (!query.isEmpty()) {
|
||||
if (query.isNotEmpty()) {
|
||||
searchItem.expandActionView()
|
||||
searchView.setQuery(query, true)
|
||||
searchView.clearFocus()
|
||||
|
@ -101,6 +101,8 @@ class LibraryPresenter(
|
||||
subscribeLibrary()
|
||||
}
|
||||
|
||||
fun hasPendingDownloads() = downloadManager.hasQueue()
|
||||
|
||||
/**
|
||||
* Subscribes to library if needed.
|
||||
*/
|
||||
|
@ -149,12 +149,7 @@ open class MainActivity : BaseActivity() {
|
||||
R.id.nav_drawer_downloads -> {
|
||||
router.pushController(DownloadController().withFadeTransaction())
|
||||
}
|
||||
R.id.nav_drawer_settings -> {
|
||||
router.pushController(SettingsMainController().withFadeTransaction())
|
||||
}
|
||||
R.id.nav_drawer_help -> {
|
||||
openInBrowser(URL_HELP)
|
||||
}
|
||||
R.id.nav_drawer_settings -> setRoot(SettingsMainController(), id)
|
||||
}
|
||||
//navigationView.selectedItemId = id
|
||||
}
|
||||
|
@ -7,8 +7,8 @@ import android.util.AttributeSet
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
||||
import eu.kanade.tachiyomi.data.preference.getOrDefault
|
||||
import eu.kanade.tachiyomi.util.gone
|
||||
import eu.kanade.tachiyomi.util.visible
|
||||
import eu.kanade.tachiyomi.util.view.gone
|
||||
import eu.kanade.tachiyomi.util.view.visible
|
||||
import kotlinx.android.synthetic.main.preference_update_text.view.*
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
|
@ -20,7 +20,7 @@
|
||||
<item
|
||||
android:id="@+id/action_downloads"
|
||||
android:icon="@drawable/ic_file_download_white_24dp"
|
||||
android:title="@string/pref_category_downloads"
|
||||
android:title="@string/label_download_queue"
|
||||
app:showAsAction="ifRoom"/>
|
||||
|
||||
<item
|
||||
|
@ -27,19 +27,10 @@
|
||||
<item
|
||||
android:id="@+id/nav_drawer_downloads"
|
||||
android:icon="@drawable/ic_file_download_black_24dp"
|
||||
android:title="@string/label_download_queue"
|
||||
android:checkable="false" />
|
||||
</group>
|
||||
<group android:checkableBehavior="single">
|
||||
android:title="@string/label_download_queue" />
|
||||
<item
|
||||
android:id="@+id/nav_drawer_settings"
|
||||
android:icon="@drawable/ic_settings_black_24dp"
|
||||
android:title="@string/label_settings"
|
||||
android:checkable="false" />
|
||||
<item
|
||||
android:id="@+id/nav_drawer_help"
|
||||
android:icon="@drawable/ic_help_black_24dp"
|
||||
android:title="@string/label_help"
|
||||
android:checkable="false" />
|
||||
android:title="@string/label_settings" />
|
||||
</group>
|
||||
</menu>
|
||||
|
Loading…
Reference in New Issue
Block a user