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 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.
|
||||||
|
@ -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()
|
||||||
|
@ -101,6 +101,8 @@ class LibraryPresenter(
|
|||||||
subscribeLibrary()
|
subscribeLibrary()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun hasPendingDownloads() = downloadManager.hasQueue()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Subscribes to library if needed.
|
* Subscribes to library if needed.
|
||||||
*/
|
*/
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user