From cc28ff7a777b061465442fd403c8fe031e6afa1b Mon Sep 17 00:00:00 2001 From: Jay Date: Sun, 15 Mar 2020 22:21:14 -0700 Subject: [PATCH] Using selector for tab icons --- .../ui/catalogue/CatalogueController.kt | 4 + .../ui/extension/ExtensionBottomPresenter.kt | 5 +- .../ui/extension/ExtensionController.kt | 224 ------------------ .../ui/extension/ExtensionPresenter.kt | 148 ------------ .../ui/library/LibraryListController.kt | 2 +- .../kanade/tachiyomi/ui/main/MainActivity.kt | 56 ++--- .../RecentChaptersController.kt | 2 +- .../recently_read/RecentlyReadController.kt | 2 +- .../res/drawable/browse_selector_24dp.xml | 5 + .../res/drawable/library_selector_24dp.xml | 5 + .../drawable/recent_read_selector_24dp.xml | 5 + .../drawable/recent_updates_selector_24dp.xml | 5 + app/src/main/res/menu/bottom_navigation.xml | 6 +- 13 files changed, 48 insertions(+), 421 deletions(-) delete mode 100644 app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionController.kt delete mode 100644 app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionPresenter.kt create mode 100644 app/src/main/res/drawable/browse_selector_24dp.xml create mode 100644 app/src/main/res/drawable/library_selector_24dp.xml create mode 100644 app/src/main/res/drawable/recent_read_selector_24dp.xml create mode 100644 app/src/main/res/drawable/recent_updates_selector_24dp.xml diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueController.kt index a8044b8a63..8d11a52275 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueController.kt @@ -178,6 +178,10 @@ class CatalogueController : NucleusController(), } + fun showExtensions() { + ext_bottom_sheet.sheetBehavior?.state = BottomSheetBehavior.STATE_EXPANDED + } + fun toggleExtensions() { if (ext_bottom_sheet.sheetBehavior?.state != BottomSheetBehavior.STATE_COLLAPSED) { ext_bottom_sheet.sheetBehavior?.state = BottomSheetBehavior.STATE_COLLAPSED diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionBottomPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionBottomPresenter.kt index 2c1793ae6a..43d9c22b7a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionBottomPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionBottomPresenter.kt @@ -19,8 +19,11 @@ import uy.kohesive.injekt.api.get import java.util.concurrent.TimeUnit import kotlin.coroutines.CoroutineContext +typealias ExtensionTuple + = Triple, List, List> + /** - * Presenter of [ExtensionController]. + * Presenter of [ExtensionBottomSheet]. */ open class ExtensionBottomPresenter( private val bottomSheet: ExtensionBottomSheet, diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionController.kt deleted file mode 100644 index 0e7c5e445c..0000000000 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionController.kt +++ /dev/null @@ -1,224 +0,0 @@ -package eu.kanade.tachiyomi.ui.extension - -import android.view.LayoutInflater -import android.view.Menu -import android.view.MenuInflater -import android.view.MenuItem -import android.view.View -import android.view.ViewGroup -import androidx.appcompat.widget.SearchView -import com.bluelinelabs.conductor.ControllerChangeHandler -import com.bluelinelabs.conductor.ControllerChangeType -import com.bluelinelabs.conductor.RouterTransaction -import com.bluelinelabs.conductor.changehandler.FadeChangeHandler -import com.jakewharton.rxbinding.support.v4.widget.refreshes -import com.jakewharton.rxbinding.support.v7.widget.queryTextChanges -import eu.davidea.flexibleadapter.FlexibleAdapter -import eu.davidea.flexibleadapter.items.IFlexible -import eu.kanade.tachiyomi.R -import eu.kanade.tachiyomi.data.preference.PreferencesHelper -import eu.kanade.tachiyomi.data.preference.getOrDefault -import eu.kanade.tachiyomi.extension.ExtensionUpdateJob -import eu.kanade.tachiyomi.extension.model.Extension -import eu.kanade.tachiyomi.ui.base.controller.NucleusController -import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction -import eu.kanade.tachiyomi.util.view.RecyclerWindowInsetsListener -import eu.kanade.tachiyomi.util.view.scrollViewWith -import kotlinx.android.synthetic.main.extension_controller.* -import uy.kohesive.injekt.Injekt -import uy.kohesive.injekt.api.get - -/** - * Controller to manage the catalogues available in the app. - */ -open class ExtensionController : NucleusController(), - ExtensionAdapter.OnButtonClickListener, - FlexibleAdapter.OnItemClickListener, - FlexibleAdapter.OnItemLongClickListener, - ExtensionTrustDialog.Listener { - - /** - * Adapter containing the list of manga from the catalogue. - */ - private var adapter: FlexibleAdapter>? = null - - private var extensions: List = emptyList() - - private var query = "" - - init { - setHasOptionsMenu(true) - } - - override fun getTitle(): String? { - return applicationContext?.getString(R.string.label_extensions) - } - - override fun createPresenter(): ExtensionPresenter { - return ExtensionPresenter() - } - - override fun inflateView(inflater: LayoutInflater, container: ViewGroup): View { - return inflater.inflate(R.layout.extension_controller, container, false) - } - - override fun onViewCreated(view: View) { - super.onViewCreated(view) - //view.applyWindowInsetsForController() - - ext_swipe_refresh.isRefreshing = true - ext_swipe_refresh.refreshes().subscribeUntilDestroy { - presenter.findAvailableExtensions() - } - - // Initialize adapter, scroll listener and recycler views - adapter = ExtensionAdapter(this) - // Create recycler and set adapter. - ext_recycler.layoutManager = androidx.recyclerview.widget.LinearLayoutManager(view.context) - ext_recycler.adapter = adapter - ext_recycler.addItemDecoration(ExtensionDividerItemDecoration(view.context)) - ext_recycler.setOnApplyWindowInsetsListener(RecyclerWindowInsetsListener) - scrollViewWith(ext_recycler, true, ext_swipe_refresh) - } - - override fun onDestroyView(view: View) { - adapter = null - super.onDestroyView(view) - } - - override fun onOptionsItemSelected(item: MenuItem): Boolean { - when (item.itemId) { - R.id.action_search -> expandActionViewFromInteraction = true - R.id.action_filter -> { - router.pushController((RouterTransaction.with(SettingsExtensionsController())) - .popChangeHandler(SettingsExtensionsFadeChangeHandler()) - .pushChangeHandler(FadeChangeHandler())) - } - R.id.action_auto_check -> { - item.isChecked = !item.isChecked - val preferences:PreferencesHelper = Injekt.get() - preferences.automaticExtUpdates().set(item.isChecked) - - if (item.isChecked) - ExtensionUpdateJob.setupTask() - else - ExtensionUpdateJob.cancelTask() - } - else -> return super.onOptionsItemSelected(item) - } - return true - } - - override fun onChangeStarted(handler: ControllerChangeHandler, type: ControllerChangeType) { - super.onChangeStarted(handler, type) - if (!type.isPush && handler is SettingsExtensionsFadeChangeHandler) { - presenter.findAvailableExtensions() - } - } - - override fun onButtonClick(position: Int) { - val extension = (adapter?.getItem(position) as? ExtensionItem)?.extension ?: return - when (extension) { - is Extension.Installed -> { - if (!extension.hasUpdate) { - openDetails(extension) - } else { - presenter.updateExtension(extension) - } - } - is Extension.Available -> { - presenter.installExtension(extension) - } - is Extension.Untrusted -> { - openTrustDialog(extension) - } - } - } - - override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) { - inflater.inflate(R.menu.extension_main, menu) - - val searchItem = menu.findItem(R.id.action_search) - val searchView = searchItem.actionView as SearchView - searchView.maxWidth = Int.MAX_VALUE - - if (query.isNotEmpty()) { - searchItem.expandActionView() - searchView.setQuery(query, true) - searchView.clearFocus() - } - - searchView.queryTextChanges() - .filter { router.backstack.lastOrNull()?.controller() == this } - .subscribeUntilDestroy { - query = it.toString() - drawExtensions() - } - - // Fixes problem with the overflow icon showing up in lieu of search - searchItem.fixExpand(onExpand = { invalidateMenuOnExpand() }) - - val autoItem = menu.findItem(R.id.action_auto_check) - val preferences:PreferencesHelper = Injekt.get() - autoItem.isChecked = preferences.automaticExtUpdates().getOrDefault() - } - - override fun onItemClick(view: View?, position: Int): Boolean { - val extension = (adapter?.getItem(position) as? ExtensionItem)?.extension ?: return false - if (extension is Extension.Installed) { - openDetails(extension) - } else if (extension is Extension.Untrusted) { - openTrustDialog(extension) - } - - return false - } - - override fun onItemLongClick(position: Int) { - val extension = (adapter?.getItem(position) as? ExtensionItem)?.extension ?: return - if (extension is Extension.Installed || extension is Extension.Untrusted) { - uninstallExtension(extension.pkgName) - } - } - - private fun openDetails(extension: Extension.Installed) { - val controller = ExtensionDetailsController(extension.pkgName) - router.pushController(controller.withFadeTransaction()) - } - - private fun openTrustDialog(extension: Extension.Untrusted) { - ExtensionTrustDialog(this, extension.signatureHash, extension.pkgName) - .showDialog(router) - } - - fun setExtensions(extensions: List) { - ext_swipe_refresh?.isRefreshing = false - this.extensions = extensions - drawExtensions() - } - - fun drawExtensions() { - if (!query.isBlank()) { - adapter?.updateDataSet( - extensions.filter { - it.extension.name.contains(query, ignoreCase = true) - }) - } else { - adapter?.updateDataSet(extensions) - } - } - - fun downloadUpdate(item: ExtensionItem) { - adapter?.updateItem(item, item.installStep) - } - - override fun trustSignature(signatureHash: String) { - presenter.trustSignature(signatureHash) - } - - override fun uninstallExtension(pkgName: String) { - presenter.uninstallExtension(pkgName) - } - - class SettingsExtensionsFadeChangeHandler : FadeChangeHandler() -} diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionPresenter.kt deleted file mode 100644 index 5830d35569..0000000000 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/extension/ExtensionPresenter.kt +++ /dev/null @@ -1,148 +0,0 @@ -package eu.kanade.tachiyomi.ui.extension - -import android.app.Application -import android.os.Bundle -import eu.kanade.tachiyomi.R -import eu.kanade.tachiyomi.data.preference.PreferencesHelper -import eu.kanade.tachiyomi.data.preference.getOrDefault -import eu.kanade.tachiyomi.extension.ExtensionManager -import eu.kanade.tachiyomi.extension.model.Extension -import eu.kanade.tachiyomi.extension.model.InstallStep -import eu.kanade.tachiyomi.ui.base.presenter.BasePresenter -import eu.kanade.tachiyomi.util.system.LocaleHelper -import rx.Observable -import rx.Subscription -import rx.android.schedulers.AndroidSchedulers -import uy.kohesive.injekt.Injekt -import uy.kohesive.injekt.api.get -import java.util.concurrent.TimeUnit - -typealias ExtensionTuple - = Triple, List, List> - -/** - * Presenter of [ExtensionController]. - */ -open class ExtensionPresenter( - private val extensionManager: ExtensionManager = Injekt.get(), - private val preferences: PreferencesHelper = Injekt.get() -) : BasePresenter() { - - private var extensions = emptyList() - - private var currentDownloads = hashMapOf() - - override fun onCreate(savedState: Bundle?) { - super.onCreate(savedState) - - extensionManager.findAvailableExtensions() - bindToExtensionsObservable() - } - - private fun bindToExtensionsObservable(): Subscription { - val installedObservable = extensionManager.getInstalledExtensionsObservable() - val untrustedObservable = extensionManager.getUntrustedExtensionsObservable() - val availableObservable = extensionManager.getAvailableExtensionsObservable() - .startWith(emptyList()) - - return Observable.combineLatest(installedObservable, untrustedObservable, availableObservable) - { installed, untrusted, available -> Triple(installed, untrusted, available) } - .debounce(100, TimeUnit.MILLISECONDS) - .map(::toItems) - .observeOn(AndroidSchedulers.mainThread()) - .subscribeLatestCache({ view, _ -> view.setExtensions(extensions) }) - } - - @Synchronized - private fun toItems(tuple: ExtensionTuple): List { - val context = Injekt.get() - val activeLangs = preferences.enabledLanguages().getOrDefault() - - val (installed, untrusted, available) = tuple - - val items = mutableListOf() - - val installedSorted = installed.sortedWith(compareBy({ !it.hasUpdate }, { !it.isObsolete }, { it.pkgName })) - val untrustedSorted = untrusted.sortedBy { it.pkgName } - val availableSorted = available - // Filter out already installed extensions and disabled languages - .filter { avail -> installed.none { it.pkgName == avail.pkgName } - && untrusted.none { it.pkgName == avail.pkgName } - && (avail.lang in activeLangs || avail.lang == "all")} - .sortedBy { it.pkgName } - - if (installedSorted.isNotEmpty() || untrustedSorted.isNotEmpty()) { - val header = ExtensionGroupItem(context.getString(R.string.ext_installed), installedSorted.size + untrustedSorted.size) - items += installedSorted.map { extension -> - ExtensionItem(extension, header, currentDownloads[extension.pkgName]) - } - items += untrustedSorted.map { extension -> - ExtensionItem(extension, header) - } - } - if (availableSorted.isNotEmpty()) { - val availableGroupedByLang = availableSorted - .groupBy { LocaleHelper.getDisplayName(it.lang, context) } - .toSortedMap() - - availableGroupedByLang - .forEach { - val header = ExtensionGroupItem(it.key, it.value.size) - items += it.value.map { extension -> - ExtensionItem(extension, header, currentDownloads[extension.pkgName]) - } - } - } - - this.extensions = items - return items - } - - @Synchronized - private fun updateInstallStep(extension: Extension, state: InstallStep): ExtensionItem? { - val extensions = extensions.toMutableList() - val position = extensions.indexOfFirst { it.extension.pkgName == extension.pkgName } - - return if (position != -1) { - val item = extensions[position].copy(installStep = state) - extensions[position] = item - - this.extensions = extensions - item - } else { - null - } - } - - fun installExtension(extension: Extension.Available) { - extensionManager.installExtension(extension).subscribeToInstallUpdate(extension) - } - - fun updateExtension(extension: Extension.Installed) { - extensionManager.updateExtension(extension).subscribeToInstallUpdate(extension) - } - - private fun Observable.subscribeToInstallUpdate(extension: Extension) { - this.doOnNext { currentDownloads[extension.pkgName] = it } - .doOnUnsubscribe { currentDownloads.remove(extension.pkgName) } - .map { state -> updateInstallStep(extension, state) } - .subscribeWithView({ view, item -> - if (item != null) { - view.downloadUpdate(item) - } - }) - } - - fun uninstallExtension(pkgName: String) { - extensionManager.uninstallExtension(pkgName) - } - - fun findAvailableExtensions() { - extensionManager.findAvailableExtensions() - } - - fun trustSignature(signatureHash: String) { - extensionManager.trustSignature(signatureHash) - } - -} diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryListController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryListController.kt index aa6e2905be..deee3a6e4c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryListController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryListController.kt @@ -300,7 +300,7 @@ class LibraryListController(bundle: Bundle? = null) : LibraryController(bundle), }) recycler.setHasFixedSize(true) recycler.adapter = adapter - //adapter.fastScroller = fast_scroller + adapter.fastScroller = fast_scroller recycler.addOnScrollListener(scrollListener) val tv = TypedValue() diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt index ea1b834d4d..5294948455 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt @@ -50,7 +50,6 @@ import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction import eu.kanade.tachiyomi.ui.catalogue.CatalogueController import eu.kanade.tachiyomi.ui.catalogue.global_search.CatalogueSearchController import eu.kanade.tachiyomi.ui.download.DownloadController -import eu.kanade.tachiyomi.ui.extension.ExtensionController import eu.kanade.tachiyomi.ui.library.LibraryController import eu.kanade.tachiyomi.ui.library.LibraryListController import eu.kanade.tachiyomi.ui.manga.MangaDetailsController @@ -164,7 +163,6 @@ open class MainActivity : BaseActivity(), DownloadServiceListener { setRoot(RecentlyReadController(), id) } R.id.nav_catalogues -> setRoot(CatalogueController(), id) - //R.id.nav_settings -> setRoot(SettingsMainController(), id) } } else if (currentRoot.tag()?.toIntOrNull() == id) { @@ -175,6 +173,7 @@ open class MainActivity : BaseActivity(), DownloadServiceListener { if (!showRecents) setRoot(RecentChaptersController(), id) else setRoot(RecentlyReadController(), id) preferences.showRecentUpdates().set(!showRecents) + updateRecentsIcon() } R.id.nav_library -> { val controller = @@ -189,13 +188,11 @@ open class MainActivity : BaseActivity(), DownloadServiceListener { } } } - updateIcons(id) true } val container: ViewGroup = findViewById(R.id.controller_container) val content: ViewGroup = findViewById(R.id.main_content) - //val dwawerContainer: ViewGroup = findViewById(R.id.drawer_container) DownloadService.addListener(this) content.systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_STABLE or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or @@ -203,9 +200,7 @@ open class MainActivity : BaseActivity(), DownloadServiceListener { container.systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_STABLE or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION - /*dwawerContainer.systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_STABLE or - View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or - View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION*/ + updateRecentsIcon() content.viewTreeObserver.addOnGlobalLayoutListener { val heightDiff: Int = content.rootView.height - content.height if (heightDiff > 200 && @@ -368,31 +363,11 @@ open class MainActivity : BaseActivity(), DownloadServiceListener { setExtensionsBadge() } - override fun onRestoreInstanceState(savedInstanceState: Bundle) { - super.onRestoreInstanceState(savedInstanceState) - updateIcons(bottom_nav.selectedItemId) - } - - fun updateIcons(id: Int) { - bottom_nav.menu.findItem(R.id.nav_library).icon = AppCompatResources.getDrawable( - this, if (id == R.id.nav_library) R.drawable.library_24dp - else R.drawable.library_outline_24dp - ) - bottom_nav.menu.findItem(R.id.nav_recents).icon = AppCompatResources.getDrawable( - this, if (id == R.id.nav_recents) { - if (preferences.showRecentUpdates().getOrDefault()) R.drawable.recent_updates_24dp - else R.drawable.recent_read_24dp - } else { - if (preferences.showRecentUpdates() - .getOrDefault() - ) R.drawable.recent_updates_outline_24dp - else R.drawable.recent_read_outline_24dp - } - ) - bottom_nav.menu.findItem(R.id.nav_catalogues).icon = AppCompatResources.getDrawable( - this, if (id == R.id.nav_catalogues) R.drawable.browse_24dp - else R.drawable.browse_outline_24dp - ) + fun updateRecentsIcon() { + bottom_nav.menu.findItem(R.id.nav_recents).icon = + AppCompatResources.getDrawable(this, + if (preferences.showRecentUpdates().getOrDefault()) R.drawable.recent_updates_selector_24dp + else R.drawable.recent_read_selector_24dp) } override fun startSupportActionMode(callback: androidx.appcompat.view.ActionMode.Callback): androidx.appcompat.view.ActionMode? { @@ -466,21 +441,18 @@ open class MainActivity : BaseActivity(), DownloadServiceListener { SHORTCUT_RECENTLY_UPDATED, SHORTCUT_RECENTLY_READ -> { preferences.showRecentUpdates().set(intent.action == SHORTCUT_RECENTLY_UPDATED) bottom_nav.selectedItemId = R.id.nav_recents + updateRecentsIcon() } SHORTCUT_CATALOGUES -> bottom_nav.selectedItemId = R.id.nav_catalogues SHORTCUT_EXTENSIONS -> { - if (router.backstack.none { it.controller() is ExtensionController }) { if (router.backstack.isEmpty()) { - bottom_nav.selectedItemId = R.id.nav_library - router.pushController( - RouterTransaction.with(ExtensionController()).pushChangeHandler( - SimpleSwapChangeHandler() - ).popChangeHandler(FadeChangeHandler()) - ) - } else { - router.pushController(ExtensionController().withFadeTransaction()) + bottom_nav.selectedItemId = R.id.nav_catalogues + bottom_nav.post { + val controller = + router.backstack.firstOrNull()?.controller() as? CatalogueController + controller?.showExtensions() + } } - } } SHORTCUT_MANGA -> { val extras = intent.extras ?: return false diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/RecentChaptersController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/RecentChaptersController.kt index 17d5126db7..73253c64a4 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/RecentChaptersController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/RecentChaptersController.kt @@ -385,7 +385,7 @@ class RecentChaptersController : NucleusController(), router.setRoot( RecentlyReadController().withFadeTransaction().tag(R.id.nav_recents.toString())) Injekt.get().showRecentUpdates().set(false) - (activity as? MainActivity)?.updateIcons(R.id.nav_recents) + (activity as? MainActivity)?.updateRecentsIcon() } } return super.onOptionsItemSelected(item) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/recently_read/RecentlyReadController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/recently_read/RecentlyReadController.kt index 047747c63e..2ef1fe5ac2 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/recently_read/RecentlyReadController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/recently_read/RecentlyReadController.kt @@ -239,7 +239,7 @@ class RecentlyReadController(bundle: Bundle? = null) : BaseController(bundle), router.setRoot( RecentChaptersController().withFadeTransaction().tag(R.id.nav_recents.toString())) Injekt.get().showRecentUpdates().set(true) - (activity as? MainActivity)?.updateIcons(R.id.nav_recents) + (activity as? MainActivity)?.updateRecentsIcon() } } return super.onOptionsItemSelected(item) diff --git a/app/src/main/res/drawable/browse_selector_24dp.xml b/app/src/main/res/drawable/browse_selector_24dp.xml new file mode 100644 index 0000000000..c3b8628648 --- /dev/null +++ b/app/src/main/res/drawable/browse_selector_24dp.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/library_selector_24dp.xml b/app/src/main/res/drawable/library_selector_24dp.xml new file mode 100644 index 0000000000..77ab41c7e2 --- /dev/null +++ b/app/src/main/res/drawable/library_selector_24dp.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/recent_read_selector_24dp.xml b/app/src/main/res/drawable/recent_read_selector_24dp.xml new file mode 100644 index 0000000000..65de23f524 --- /dev/null +++ b/app/src/main/res/drawable/recent_read_selector_24dp.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/recent_updates_selector_24dp.xml b/app/src/main/res/drawable/recent_updates_selector_24dp.xml new file mode 100644 index 0000000000..3748b43760 --- /dev/null +++ b/app/src/main/res/drawable/recent_updates_selector_24dp.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/menu/bottom_navigation.xml b/app/src/main/res/menu/bottom_navigation.xml index 20b4eb2abd..1ff9783cd5 100644 --- a/app/src/main/res/menu/bottom_navigation.xml +++ b/app/src/main/res/menu/bottom_navigation.xml @@ -5,15 +5,15 @@