Dependency updates. Enable new translations. Minor fixes

This commit is contained in:
len 2017-07-08 16:44:01 +02:00
parent 90d27147e6
commit bb40a4d6b8
3 changed files with 20 additions and 10 deletions

View file

@ -122,7 +122,7 @@ dependencies {
compile 'com.github.pwittchen:reactivenetwork:0.7.0' compile 'com.github.pwittchen:reactivenetwork:0.7.0'
// Network client // 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' compile 'com.squareup.okio:okio:1.13.0'
// REST // REST
@ -132,7 +132,7 @@ dependencies {
compile "com.squareup.retrofit2:adapter-rxjava:$retrofit_version" compile "com.squareup.retrofit2:adapter-rxjava:$retrofit_version"
// JSON // 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' compile 'com.github.salomonbrys.kotson:kotson:2.5.0'
// YAML // YAML
@ -146,11 +146,11 @@ dependencies {
compile 'com.github.seven332:unifile:1.0.0' compile 'com.github.seven332:unifile:1.0.0'
// HTML parser // HTML parser
compile 'org.jsoup:jsoup:1.10.2' compile 'org.jsoup:jsoup:1.10.3'
// Job scheduling // Job scheduling
compile 'com.evernote:android-job:1.1.8' compile 'com.evernote:android-job:1.1.11'
compile 'com.google.android.gms:play-services-gcm:10.2.0' compile 'com.google.android.gms:play-services-gcm:11.0.1'
// Changelog // Changelog
compile 'com.github.gabrielemariotti.changeloglib:changelog:2.1.0' compile 'com.github.gabrielemariotti.changeloglib:changelog:2.1.0'
@ -161,7 +161,6 @@ dependencies {
// Model View Presenter // Model View Presenter
final nucleus_version = '3.0.0' final nucleus_version = '3.0.0'
compile "info.android15.nucleus:nucleus:$nucleus_version" 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" compile "info.android15.nucleus:nucleus-support-v7:$nucleus_version"
// Dependency injection // Dependency injection
@ -194,7 +193,7 @@ dependencies {
compile 'com.nightlynexus.viewstatepageradapter:viewstatepageradapter:1.0.4' compile 'com.nightlynexus.viewstatepageradapter:viewstatepageradapter:1.0.4'
// Conductor // Conductor
compile "com.bluelinelabs:conductor:2.1.2" compile "com.bluelinelabs:conductor:2.1.4"
compile 'com.github.inorichi:conductor-support-preference:9e36460' compile 'com.github.inorichi:conductor-support-preference:9e36460'
// RxBindings // RxBindings

View file

@ -32,6 +32,7 @@ import eu.kanade.tachiyomi.ui.manga.track.TrackController
import eu.kanade.tachiyomi.util.toast import eu.kanade.tachiyomi.util.toast
import kotlinx.android.synthetic.main.main_activity.* import kotlinx.android.synthetic.main.main_activity.*
import kotlinx.android.synthetic.main.manga_controller.view.* import kotlinx.android.synthetic.main.manga_controller.view.*
import rx.Subscription
import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get import uy.kohesive.injekt.api.get
@ -67,6 +68,10 @@ class MangaController : RxController, TabbedController {
val mangaFavoriteRelay: PublishRelay<Boolean> = PublishRelay.create() val mangaFavoriteRelay: PublishRelay<Boolean> = PublishRelay.create()
private val trackingIconRelay: BehaviorRelay<Boolean> = BehaviorRelay.create()
private var trackingIconSubscription: Subscription? = null
override fun getTitle(): String? { override fun getTitle(): String? {
return manga?.title return manga?.title
} }
@ -103,6 +108,7 @@ class MangaController : RxController, TabbedController {
super.onChangeStarted(handler, type) super.onChangeStarted(handler, type)
if (type.isEnter) { if (type.isEnter) {
activity?.tabs?.setupWithViewPager(view?.view_pager) activity?.tabs?.setupWithViewPager(view?.view_pager)
trackingIconSubscription = trackingIconRelay.subscribe { setTrackingIconInternal(it) }
} }
} }
@ -122,16 +128,20 @@ class MangaController : RxController, TabbedController {
} }
override fun cleanupTabs(tabs: TabLayout) { override fun cleanupTabs(tabs: TabLayout) {
setTrackingIcon(false) trackingIconSubscription?.unsubscribe()
setTrackingIconInternal(false)
} }
fun setTrackingIcon(visible: Boolean) { fun setTrackingIcon(visible: Boolean) {
trackingIconRelay.call(visible)
}
private fun setTrackingIconInternal(visible: Boolean) {
val tab = activity?.tabs?.getTabAt(TRACK_CONTROLLER) ?: return val tab = activity?.tabs?.getTabAt(TRACK_CONTROLLER) ?: return
val drawable = if (visible) val drawable = if (visible)
VectorDrawableCompat.create(resources!!, R.drawable.ic_done_white_18dp, null) VectorDrawableCompat.create(resources!!, R.drawable.ic_done_white_18dp, null)
else null else null
// I had no choice but to use reflection...
val view = tabField.get(tab) as LinearLayout val view = tabField.get(tab) as LinearLayout
val textView = view.getChildAt(1) as TextView val textView = view.getChildAt(1) as TextView
textView.setCompoundDrawablesWithIntrinsicBounds(null, null, drawable, null) textView.setCompoundDrawablesWithIntrinsicBounds(null, null, drawable, null)

View file

@ -29,7 +29,8 @@ class SettingsGeneralController : SettingsController() {
listPreference { listPreference {
key = Keys.lang key = Keys.lang
titleRes = R.string.pref_language 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 -> entries = entryValues.map { value ->
val locale = LocaleHelper.getLocaleFromString(value.toString()) val locale = LocaleHelper.getLocaleFromString(value.toString())
locale?.getDisplayName(locale)?.capitalize() ?: locale?.getDisplayName(locale)?.capitalize() ?: