Permalink
Browse files

Replace deprecated sortBy usages.

  • Loading branch information...
1 parent 3ee40f8 commit 4184e03350cdaa4f11afca4b32480e1c706051b6 @ilya-g ilya-g committed Oct 5, 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()
@@ -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!! }),

0 comments on commit 4184e03

Please sign in to comment.