Fixing imports

This commit is contained in:
Jay 2020-02-04 23:21:12 -08:00
parent b3842cd9ea
commit 98972e76c9
7 changed files with 14 additions and 26 deletions

View File

@ -120,6 +120,7 @@ class DownloadManager(val context: Context) {
fun isPaused() = downloader.isPaused() fun isPaused() = downloader.isPaused()
fun hasQueue() = downloader.queue.isNotEmpty()
/** /**
* Tells the downloader to enqueue the given list of chapters. * Tells the downloader to enqueue the given list of chapters.

View File

@ -1,9 +1,9 @@
package eu.kanade.tachiyomi.ui.library package eu.kanade.tachiyomi.ui.library
import android.app.DownloadManager
import android.content.Context import android.content.Context
import android.content.res.Configuration import android.content.res.Configuration
import android.graphics.Color import android.graphics.Color
import android.os.Build
import android.os.Bundle import android.os.Bundle
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.Menu import android.view.Menu
@ -12,7 +12,6 @@ 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.WindowInsets
import android.view.WindowManager
import android.view.inputmethod.InputMethodManager import android.view.inputmethod.InputMethodManager
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.view.ActionMode 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.design.PreMigrationController
import eu.kanade.tachiyomi.ui.migration.manga.process.MigrationListController import eu.kanade.tachiyomi.ui.migration.manga.process.MigrationListController
import eu.kanade.tachiyomi.ui.migration.manga.process.MigrationProcedureConfig import eu.kanade.tachiyomi.ui.migration.manga.process.MigrationProcedureConfig
import eu.kanade.tachiyomi.ui.setting.SettingsAdvancedController import eu.kanade.tachiyomi.util.system.getResourceColor
import eu.kanade.tachiyomi.util.view.doOnApplyWindowInsets
import eu.kanade.tachiyomi.util.view.inflate import eu.kanade.tachiyomi.util.view.inflate
import eu.kanade.tachiyomi.util.view.marginBottom import eu.kanade.tachiyomi.util.view.marginBottom
import eu.kanade.tachiyomi.util.view.marginTop import eu.kanade.tachiyomi.util.view.marginTop
@ -440,9 +438,10 @@ class LibraryController(
val searchView = searchItem.actionView as SearchView val searchView = searchItem.actionView as SearchView
searchView.queryHint = resources?.getString(R.string.search_hint) 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() searchItem.collapseActionView()
if (!query.isEmpty()) { if (query.isNotEmpty()) {
searchItem.expandActionView() searchItem.expandActionView()
searchView.setQuery(query, true) searchView.setQuery(query, true)
searchView.clearFocus() searchView.clearFocus()

View File

@ -101,6 +101,8 @@ class LibraryPresenter(
subscribeLibrary() subscribeLibrary()
} }
fun hasPendingDownloads() = downloadManager.hasQueue()
/** /**
* Subscribes to library if needed. * Subscribes to library if needed.
*/ */

View File

@ -149,12 +149,7 @@ open class MainActivity : BaseActivity() {
R.id.nav_drawer_downloads -> { R.id.nav_drawer_downloads -> {
router.pushController(DownloadController().withFadeTransaction()) router.pushController(DownloadController().withFadeTransaction())
} }
R.id.nav_drawer_settings -> { R.id.nav_drawer_settings -> setRoot(SettingsMainController(), id)
router.pushController(SettingsMainController().withFadeTransaction())
}
R.id.nav_drawer_help -> {
openInBrowser(URL_HELP)
}
} }
//navigationView.selectedItemId = id //navigationView.selectedItemId = id
} }

View File

@ -7,8 +7,8 @@ import android.util.AttributeSet
import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.data.preference.PreferencesHelper
import eu.kanade.tachiyomi.data.preference.getOrDefault import eu.kanade.tachiyomi.data.preference.getOrDefault
import eu.kanade.tachiyomi.util.gone import eu.kanade.tachiyomi.util.view.gone
import eu.kanade.tachiyomi.util.visible import eu.kanade.tachiyomi.util.view.visible
import kotlinx.android.synthetic.main.preference_update_text.view.* import kotlinx.android.synthetic.main.preference_update_text.view.*
import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get import uy.kohesive.injekt.api.get

View File

@ -20,7 +20,7 @@
<item <item
android:id="@+id/action_downloads" android:id="@+id/action_downloads"
android:icon="@drawable/ic_file_download_white_24dp" android:icon="@drawable/ic_file_download_white_24dp"
android:title="@string/pref_category_downloads" android:title="@string/label_download_queue"
app:showAsAction="ifRoom"/> app:showAsAction="ifRoom"/>
<item <item

View File

@ -27,19 +27,10 @@
<item <item
android:id="@+id/nav_drawer_downloads" android:id="@+id/nav_drawer_downloads"
android:icon="@drawable/ic_file_download_black_24dp" android:icon="@drawable/ic_file_download_black_24dp"
android:title="@string/label_download_queue" android:title="@string/label_download_queue" />
android:checkable="false" />
</group>
<group android:checkableBehavior="single">
<item <item
android:id="@+id/nav_drawer_settings" android:id="@+id/nav_drawer_settings"
android:icon="@drawable/ic_settings_black_24dp" android:icon="@drawable/ic_settings_black_24dp"
android:title="@string/label_settings" 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" />
</group> </group>
</menu> </menu>