From 2e346cfe8f43e0ab82cd96d16a4db00deed64854 Mon Sep 17 00:00:00 2001 From: Bradlee Speice Date: Sat, 13 Jun 2015 20:13:18 -0400 Subject: [PATCH] Fix up some Kotlin issues with M12 --- .../activity/downloader/manager/RefreshManager.kt | 12 ++---------- .../minimalbible/activity/search/SearchProvider.kt | 8 +------- .../minimalbible/activity/viewer/BibleMenu.kt | 12 +----------- .../service/format/osisparser/handler/TagHandler.kt | 4 +--- .../jsword/versification/VersificationUtil.kt | 2 +- jsword-minimalbible | 2 +- 6 files changed, 7 insertions(+), 33 deletions(-) diff --git a/app/src/main/kotlin/org/bspeice/minimalbible/activity/downloader/manager/RefreshManager.kt b/app/src/main/kotlin/org/bspeice/minimalbible/activity/downloader/manager/RefreshManager.kt index 92e4984..35561c7 100644 --- a/app/src/main/kotlin/org/bspeice/minimalbible/activity/downloader/manager/RefreshManager.kt +++ b/app/src/main/kotlin/org/bspeice/minimalbible/activity/downloader/manager/RefreshManager.kt @@ -1,17 +1,9 @@ package org.bspeice.minimalbible.activity.downloader.manager -import org.crosswire.jsword.book.install.Installer +import org.bspeice.minimalbible.activity.downloader.DownloadPrefs import rx.Observable -import org.crosswire.jsword.book.Book import rx.schedulers.Schedulers import java.util.Calendar -import org.bspeice.minimalbible.activity.downloader.DownloadPrefs -import android.net.ConnectivityManager -import org.crosswire.jsword.book.BookComparators - -/** - * Created by bspeice on 10/22/14. - */ class RefreshManager(val installers: Collection, val exclude: List, @@ -44,7 +36,7 @@ class RefreshManager(val installers: Collection, // Lists -> Single list .flatMap { Observable.from(it) } - val flatModulesSorted = flatModules.toSortedList {(book1, book2) -> + val flatModulesSorted = flatModules.toSortedList { book1, book2 -> BookComparators.getInitialComparator().compare(book1, book2) } diff --git a/app/src/main/kotlin/org/bspeice/minimalbible/activity/search/SearchProvider.kt b/app/src/main/kotlin/org/bspeice/minimalbible/activity/search/SearchProvider.kt index ab5412f..b186057 100644 --- a/app/src/main/kotlin/org/bspeice/minimalbible/activity/search/SearchProvider.kt +++ b/app/src/main/kotlin/org/bspeice/minimalbible/activity/search/SearchProvider.kt @@ -1,11 +1,5 @@ package org.bspeice.minimalbible.activity.search -import org.crosswire.jsword.passage.Verse -import org.crosswire.jsword.index.search.SearchType -import org.crosswire.jsword.book.Book -import android.util.Log -import org.crosswire.jsword.index.IndexManager - /** * This is the entry point for handling the actual bible search. Likely will support * an "advanced" search in the future, but for now, basicTextSearch is what you get. @@ -14,7 +8,7 @@ class SearchProvider(val indexManager: IndexManager, val book: Book?) { val defaultSearchType = SearchType.ANY_WORDS - [suppress("UNUSED_PARAMETER")] + @suppress("UNUSED_PARAMETER") public fun basicTextSearch(text: String): List { if (!isSearchAvailable()) { Log.w("SearchProvider", "Search unavailable, index status of ${book?.getInitials()}: ${book?.getIndexStatus()}") diff --git a/app/src/main/kotlin/org/bspeice/minimalbible/activity/viewer/BibleMenu.kt b/app/src/main/kotlin/org/bspeice/minimalbible/activity/viewer/BibleMenu.kt index c3c04d2..a96f572 100644 --- a/app/src/main/kotlin/org/bspeice/minimalbible/activity/viewer/BibleMenu.kt +++ b/app/src/main/kotlin/org/bspeice/minimalbible/activity/viewer/BibleMenu.kt @@ -1,16 +1,6 @@ package org.bspeice.minimalbible.activity.viewer -import android.content.Context -import android.content.res.Resources -import android.util.AttributeSet -import android.view.LayoutInflater -import android.view.View -import android.widget.ExpandableListView -import android.widget.LinearLayout -import android.widget.TextView import org.bspeice.minimalbible.R -import org.crosswire.jsword.book.Book -import org.crosswire.jsword.versification.BibleBook import rx.subjects.PublishSubject class BibleMenu(val ctx: Context, val attrs: AttributeSet) : LinearLayout(ctx, attrs) { @@ -29,7 +19,7 @@ class BibleMenu(val ctx: Context, val attrs: AttributeSet) : LinearLayout(ctx, a class BibleMenuGroup(val bindTo: View) { val content = bindTo.findViewById(R.id.content) as TextView - val resources = bindTo.getResources(): Resources + val resources = bindTo.getResources() companion object { fun init(v: View, obj: Any, highlighted: Boolean): View { diff --git a/app/src/main/kotlin/org/bspeice/minimalbible/service/format/osisparser/handler/TagHandler.kt b/app/src/main/kotlin/org/bspeice/minimalbible/service/format/osisparser/handler/TagHandler.kt index 651c5ec..5d11e7d 100644 --- a/app/src/main/kotlin/org/bspeice/minimalbible/service/format/osisparser/handler/TagHandler.kt +++ b/app/src/main/kotlin/org/bspeice/minimalbible/service/format/osisparser/handler/TagHandler.kt @@ -1,11 +1,9 @@ package org.bspeice.minimalbible.service.format.osisparser.handler -import android.text.SpannableStringBuilder -import android.text.style.CharacterStyle import org.bspeice.minimalbible.service.format.osisparser.VerseContent import org.xml.sax.Attributes -trait TagHandler { +interface TagHandler { fun start(attrs: Attributes, info: VerseContent, builder: SpannableStringBuilder, state: ParseState): ParseState diff --git a/app/src/main/kotlin/org/crosswire/jsword/versification/VersificationUtil.kt b/app/src/main/kotlin/org/crosswire/jsword/versification/VersificationUtil.kt index 1d5dc5b..cf7d3b8 100644 --- a/app/src/main/kotlin/org/crosswire/jsword/versification/VersificationUtil.kt +++ b/app/src/main/kotlin/org/crosswire/jsword/versification/VersificationUtil.kt @@ -6,7 +6,7 @@ import java.util.ArrayList * VersificationUtil class allows Java to easily reach in to Kotlin */ object INTRO_BOOKS { - val INTROS = array( + val INTROS = arrayOf( BibleBook.INTRO_BIBLE, BibleBook.INTRO_OT, BibleBook.INTRO_NT diff --git a/jsword-minimalbible b/jsword-minimalbible index 3da3166..601af59 160000 --- a/jsword-minimalbible +++ b/jsword-minimalbible @@ -1 +1 @@ -Subproject commit 3da31666ef062b8b59a40492b7574f18b49f6f6d +Subproject commit 601af59763e574f6b320c8d9207741229bba5956