Permalink
Browse files

Merge pull request #21 from ilya-g/master

Fix compilation and replace some deprecated symbol usages
  • Loading branch information...
2 parents a495f9a + 8afeefc commit 589ea91e609b02be3d6d67511f9f46c7e53a3328 @dodyg committed Oct 6, 2015
@@ -20,7 +20,7 @@ package com.silverkeytech.news_engine.outlines
fun sortOutlineDesc(outlines: List<Outline>): List<Outline> {
- var sortedOutlines = outlines.sortBy(
+ var sortedOutlines = outlines.sortedWith(
comparator { p1: Outline, p2: Outline ->
val text1 = p1.text
val text2 = p2.text
@@ -41,7 +41,7 @@ fun sortOutlineDesc(outlines: List<Outline>): List<Outline> {
fun sortOutlineAsc(outlines: List<Outline>): List<Outline> {
- var sortedOutlines = outlines.sortBy(
+ var sortedOutlines = outlines.sortedWith(
comparator { p1: Outline, p2: Outline ->
val text1 = p1.text
val text2 = p2.text
@@ -53,7 +53,7 @@ fun accumulateList(list: Vector<RiverItemMeta>, feed: SyndicationFeed) {
}
fun sortRiverItemMeta(newsItems: List<RiverItemMeta>): List<RiverItemMeta> {
- var sortedNewsItems = newsItems.filter { x -> x.item.isPublicationDate()!! }.sortBy(
+ var sortedNewsItems = newsItems.filter { x -> x.item.isPublicationDate()!! }.sortedWith(
comparator { p1: RiverItemMeta, p2: RiverItemMeta ->
val date1 = p1.item.getPublicationDate()
val date2 = p2.item.getPublicationDate()
@@ -19,13 +19,13 @@ public class OpmlParserTests {
println("Error message : ${res.exception?.getMessage()}")
- assert(res.isTrue(), "transform operation must be true not ${res.exception?.getMessage()}")
+ assert(res.isTrue()) { "transform operation must be true not ${res.exception?.getMessage()}" }
val opml = res.value!!
- assert(!opml.head!!.title!!.isEmpty(), "Must have title")
- assert(!opml.head!!.dateModified!!.isEmpty(), "Must have date modified")
- assert(!opml.head!!.ownerName!!.isEmpty(), "Must have owner name")
- assert(!opml.head!!.ownerEmail!!.isEmpty(), "Must have owner email")
- assert(!opml.body!!.outline!!.get(0).text!!.isEmpty(), "Must have text ")
+ assert(!opml.head!!.title!!.isEmpty()) { "Must have title" }
+ assert(!opml.head!!.dateModified!!.isEmpty()) { "Must have date modified" }
+ assert(!opml.head!!.ownerName!!.isEmpty()) { "Must have owner name" }
+ assert(!opml.head!!.ownerEmail!!.isEmpty()) { "Must have owner email" }
+ assert(!opml.body!!.outline!!.get(0).text!!.isEmpty()) { "Must have text " }
println("-----------------------------------")
Binary file not shown.
View
Binary file not shown.
@@ -193,7 +193,7 @@ public class RiverActivity(): ListActivity(), WithVisualModificationPanel
if (sortedNewsItems != null && sortedNewsItems!!.size() > 0){
val distinct = ArrayList<RiverItemSource>();
var itm = sortedNewsItems!!.get(0).source
- sortedNewsItems!!.map { x -> x.source }.sortBy { x -> x.uri!! }.forEach { x ->
+ sortedNewsItems!!.map { x -> x.source }.sortedBy { x -> x.uri!! }.forEach { x ->
if (itm.uri != x.uri && !distinct.any { y -> y.uri == x.uri }){
Log.d("River Sources Collection", "${itm.uri}")
distinct.add(itm)
@@ -203,7 +203,7 @@ public class RiverActivity(): ListActivity(), WithVisualModificationPanel
Log.d(TAG, "Unique sources are ${distinct.size()}")
- val sortedDistinct = distinct.sortBy { x -> x.title!! }
+ val sortedDistinct = distinct.sortedBy { x -> x.title!! }
startRiverSourcesActivity(this, riverName, riverUrl,
ArrayList(sortedDistinct.map { x -> x.title!! }),
@@ -52,7 +52,7 @@ AbstractTreeViewAdapter<Long?>(context, treeStateManager, numberOfLevels) {
public val TAG: String = javaClass<SimpleAdapter>().getSimpleName()
}
- private open fun getDescription(id: Long?): String? {
+ private fun getDescription(id: Long?): String? {
var currentOutline = outlines.get(id!!.toInt())
return when (currentOutline.getType()){
OutlineType.INCLUDE -> currentOutline.text + " #"

0 comments on commit 589ea91

Please sign in to comment.