From d7e9dd34c930bc46eb229311fb159f15245721d1 Mon Sep 17 00:00:00 2001 From: Bradlee Speice Date: Sat, 8 Nov 2014 00:34:08 -0500 Subject: [PATCH] Expose the modulesByLanguage Can be refactored later, internal implementation uses the "proper" way of accessing things. --- .../activity/downloader/manager/LocaleManager.kt | 6 +++++- gradle/wrapper/gradle-wrapper.properties | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/org/bspeice/minimalbible/activity/downloader/manager/LocaleManager.kt b/app/src/main/kotlin/org/bspeice/minimalbible/activity/downloader/manager/LocaleManager.kt index 643eb2d..cb0f5f1 100644 --- a/app/src/main/kotlin/org/bspeice/minimalbible/activity/downloader/manager/LocaleManager.kt +++ b/app/src/main/kotlin/org/bspeice/minimalbible/activity/downloader/manager/LocaleManager.kt @@ -2,15 +2,19 @@ package org.bspeice.minimalbible.activity.downloader.manager import org.crosswire.common.util.Language import rx.Observable +import rx.observables.GroupedObservable class LocaleManager(val rM: RefreshManager) { val currentLanguage = Language.DEFAULT_LANG - val languageModuleMap = rM.flatModules + private val languageModuleMap = rM.flatModules // Language doesn't have hashCode(), so we actually group by its String .groupBy { FixedLanguage(it.getLanguage()) } + val modulesByLanguage = languageModuleMap + .map { GroupedObservable.from(it.getKey(): Language, it) } + // Cast back to the original Language implementation val availableLanguages: Observable = languageModuleMap.map { it.getKey() } val sortedLanguagesList = diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 5ace921..22421bf 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Wed Oct 22 20:42:04 EDT 2014 +#Fri Nov 07 23:02:34 EST 2014 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-1.12-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-1.12-all.zip