From bb40a4d6b840eccea11695e38f2af55746345e52 Mon Sep 17 00:00:00 2001 From: len Date: Sat, 8 Jul 2017 16:44:01 +0200 Subject: [PATCH] Dependency updates. Enable new translations. Minor fixes --- app/build.gradle | 13 ++++++------- .../kanade/tachiyomi/ui/manga/MangaController.kt | 14 ++++++++++++-- .../ui/setting/SettingsGeneralController.kt | 3 ++- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 8f22898ac..4ae65db5b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -122,7 +122,7 @@ dependencies { compile 'com.github.pwittchen:reactivenetwork:0.7.0' // Network client - compile "com.squareup.okhttp3:okhttp:3.8.0" + compile "com.squareup.okhttp3:okhttp:3.8.1" compile 'com.squareup.okio:okio:1.13.0' // REST @@ -132,7 +132,7 @@ dependencies { compile "com.squareup.retrofit2:adapter-rxjava:$retrofit_version" // JSON - compile 'com.google.code.gson:gson:2.8.0' + compile 'com.google.code.gson:gson:2.8.1' compile 'com.github.salomonbrys.kotson:kotson:2.5.0' // YAML @@ -146,11 +146,11 @@ dependencies { compile 'com.github.seven332:unifile:1.0.0' // HTML parser - compile 'org.jsoup:jsoup:1.10.2' + compile 'org.jsoup:jsoup:1.10.3' // Job scheduling - compile 'com.evernote:android-job:1.1.8' - compile 'com.google.android.gms:play-services-gcm:10.2.0' + compile 'com.evernote:android-job:1.1.11' + compile 'com.google.android.gms:play-services-gcm:11.0.1' // Changelog compile 'com.github.gabrielemariotti.changeloglib:changelog:2.1.0' @@ -161,7 +161,6 @@ dependencies { // Model View Presenter final nucleus_version = '3.0.0' compile "info.android15.nucleus:nucleus:$nucleus_version" - compile "info.android15.nucleus:nucleus-support-v4:$nucleus_version" compile "info.android15.nucleus:nucleus-support-v7:$nucleus_version" // Dependency injection @@ -194,7 +193,7 @@ dependencies { compile 'com.nightlynexus.viewstatepageradapter:viewstatepageradapter:1.0.4' // Conductor - compile "com.bluelinelabs:conductor:2.1.2" + compile "com.bluelinelabs:conductor:2.1.4" compile 'com.github.inorichi:conductor-support-preference:9e36460' // RxBindings diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt index 5c77cff87..7babfa5af 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt @@ -32,6 +32,7 @@ import eu.kanade.tachiyomi.ui.manga.track.TrackController import eu.kanade.tachiyomi.util.toast import kotlinx.android.synthetic.main.main_activity.* import kotlinx.android.synthetic.main.manga_controller.view.* +import rx.Subscription import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get @@ -67,6 +68,10 @@ class MangaController : RxController, TabbedController { val mangaFavoriteRelay: PublishRelay = PublishRelay.create() + private val trackingIconRelay: BehaviorRelay = BehaviorRelay.create() + + private var trackingIconSubscription: Subscription? = null + override fun getTitle(): String? { return manga?.title } @@ -103,6 +108,7 @@ class MangaController : RxController, TabbedController { super.onChangeStarted(handler, type) if (type.isEnter) { activity?.tabs?.setupWithViewPager(view?.view_pager) + trackingIconSubscription = trackingIconRelay.subscribe { setTrackingIconInternal(it) } } } @@ -122,16 +128,20 @@ class MangaController : RxController, TabbedController { } override fun cleanupTabs(tabs: TabLayout) { - setTrackingIcon(false) + trackingIconSubscription?.unsubscribe() + setTrackingIconInternal(false) } fun setTrackingIcon(visible: Boolean) { + trackingIconRelay.call(visible) + } + + private fun setTrackingIconInternal(visible: Boolean) { val tab = activity?.tabs?.getTabAt(TRACK_CONTROLLER) ?: return val drawable = if (visible) VectorDrawableCompat.create(resources!!, R.drawable.ic_done_white_18dp, null) else null - // I had no choice but to use reflection... val view = tabField.get(tab) as LinearLayout val textView = view.getChildAt(1) as TextView textView.setCompoundDrawablesWithIntrinsicBounds(null, null, drawable, null) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsGeneralController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsGeneralController.kt index 3e2a63aa6..5a755b4a6 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsGeneralController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsGeneralController.kt @@ -29,7 +29,8 @@ class SettingsGeneralController : SettingsController() { listPreference { key = Keys.lang titleRes = R.string.pref_language - entryValues = arrayOf("", "bg", "en", "es", "fr", "it", "pt", "ru", "vi") + entryValues = arrayOf("", "bg", "en", "es", "fr", "it", "lv", "nl", "pt", "pt-BR", "ru", + "vi") entries = entryValues.map { value -> val locale = LocaleHelper.getLocaleFromString(value.toString()) locale?.getDisplayName(locale)?.capitalize() ?: