From 218ea7267dca1df67a0dcde2c1f9b7ddc72f2d37 Mon Sep 17 00:00:00 2001 From: len Date: Wed, 23 Mar 2016 20:28:44 +0100 Subject: [PATCH] Remove lambdas --- .../source/online/english/ReadMangaToday.java | 30 +++++++++++++------ 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/source/online/english/ReadMangaToday.java b/app/src/main/java/eu/kanade/tachiyomi/data/source/online/english/ReadMangaToday.java index b94ac78717..2dfbbfdbb3 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/source/online/english/ReadMangaToday.java +++ b/app/src/main/java/eu/kanade/tachiyomi/data/source/online/english/ReadMangaToday.java @@ -3,6 +3,12 @@ package eu.kanade.tachiyomi.data.source.online.english; import android.content.Context; import android.net.Uri; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; + import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; @@ -21,12 +27,8 @@ import eu.kanade.tachiyomi.data.source.model.MangasPage; import eu.kanade.tachiyomi.util.Parser; import okhttp3.Headers; import rx.Observable; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonParser; -import com.google.gson.JsonObject; -import com.google.gson.JsonArray; +import rx.functions.Action1; +import rx.functions.Func1; public class ReadMangaToday extends Source { public static final String NAME = "ReadMangaToday"; @@ -96,11 +98,21 @@ public class ReadMangaToday extends Source { } @Override - public Observable searchMangasFromNetwork(MangasPage page, String query) { + public Observable searchMangasFromNetwork(final MangasPage page, String query) { return networkService .requestBody(searchMangaRequest(page, query), true) - .doOnNext(doc -> page.mangas = parseSearchFromJson(doc)) - .map(response -> page); + .doOnNext(new Action1() { + @Override + public void call(String doc) { + page.mangas = ReadMangaToday.this.parseSearchFromJson(doc); + } + }) + .map(new Func1() { + @Override + public MangasPage call(String response) { + return page; + } + }); } @Override