Upgrade to Pro — share decks privately, control downloads, hide ads and more …

RxJava Droidkaigi

kazy1991
February 20, 2016

RxJava Droidkaigi

Droidkaigi 2016で発表した資料です。

kazy1991

February 20, 2016
Tweet

More Decks by kazy1991

Other Decks in Technology

Transcript

  1. #FGPSF3Y+BWB儗➿ public interface Callback { void onSuccess(List<Recipe> recipes); void onError(Throwable

    t); } public void searchRecipe(String keyword, Callback callback) {
 recipeApiClient.search(keyword, callback);
 } ⢽ ٖءؾ׾嗚稊ׅ׷ꬊず劍Ⳣ椚ך؝٦س
  2. #FGPSF3Y+BWB儗➿ searchRecipe(“εςʔΩ”, new Callback() { @Override public void onSuccess(List<Recipe> recipes)

    {
 addToList(recipes); } @Override public void onError(Throwable t) { showErrorView(t); } });
 } ⢽ չأذ٦ؗպךٖءؾ׾嗚稊׃גٔأزח鷄⸇ 铣׫鴥׿דְתׅ
  3. #FGPSF3Y+BWB儗➿ searchRecipe(“εςʔΩ”, new Callback() { @Override public void onSuccess(List<Recipe> recipes)

    {
 addToList(recipes); } @Override public void onError(Throwable t) { showErrorView(t); } });
 } ⢽ չأذ٦ؗպךٖءؾ׾嗚稊׃גٔأزח鷄⸇ 铣׫鴥׿דְתׅ
  4. #FGPSF3Y+BWB儗➿ searchRecipe(“εςʔΩ”, new Callback() { @Override public void onSuccess(List<Recipe> recipes)

    {
 addToList(recipes); } @Override public void onError(Throwable t) { showErrorView(t); } });
 } ⢽ չأذ٦ؗպךٖءؾ׾嗚稊׃גٔأزח鷄⸇ 铣׫鴥׿דְתׅ
  5. #FGPSF3Y+BWB儗➿ searchRecipe(“εςʔΩ”, new Callback() { @Override public void onSuccess(List<Recipe> recipes)

    {
 addToList(recipes); } @Override public void onError(Throwable t) { showErrorView(t); } });
 } ⢽ չأذ٦ؗպךٖءؾ׾嗚稊׃גٔأزח鷄⸇
  6. #FGPSF3Y+BWB儗➿ searchRecipe(“εςʔΩ”, new Callback() { @Override public void onSuccess(List<Recipe> recipes)

    {
 addToList(recipes); } @Override public void onError(Throwable t) { showErrorView(t); } });
 } ⢽ չأذ٦ؗպךٖءؾ׾嗚稊׃גٔأزח鷄⸇ !
  7. #FGPSF3Y+BWB儗➿ searchRecipe(“εςʔΩ”, new Callback() { @Override public void onSuccess(List<Recipe> recipes)

    {
 addToList(recipes); } @Override public void onError(Throwable t) { showErrorView(t); } });
 } ⢽ չأذ٦ؗպךٖءؾ׾嗚稊׃גٔأزח鷄⸇ ! !
  8. #FGPSF3Y+BWB儗➿ searchRecipe(“εςʔΩ”, new Callback() { @Override public void onSuccess(List<Recipe> recipes)

    {
 addToList(recipes); } @Override public void onError(Throwable t) { showErrorView(t); } });
 } ⢽ չأذ٦ؗպךٖءؾ׾嗚稊׃גٔأزח鷄⸇ ! ! !
  9. #FGPSF3Y+BWB儗➿ searchRecipe(“εςʔΩ”, new Callback() { @Override public void onSuccess(List<Recipe> recipes)

    {
 addToList(recipes); } @Override public void onError(Throwable t) { showErrorView(t); } });
 } ⢽ չأذ٦ؗպךٖءؾ׾嗚稊׃גٔأزח鷄⸇ ! ! ! !
  10. #FGPSF3Y+BWB儗➿ searchRecipe(“εςʔΩ”, new Callback() { @Override public void onSuccess(List<Recipe> recipes)

    {
 addToList(recipes); } @Override public void onError(Throwable t) { showErrorView(t); } });
 } ⢽ չأذ٦ؗպךٖءؾ׾嗚稊ח㣟侁׃׋㜥さ 铣׫鴥׿דְתׅ
  11. #FGPSF3Y+BWB儗➿ searchRecipe(“εςʔΩ”, new Callback() { @Override public void onSuccess(List<Recipe> recipes)

    {
 addToList(recipes); } @Override public void onError(Throwable t) { showErrorView(t); } });
 } ⢽ չأذ٦ؗպךٖءؾ׾嗚稊ח㣟侁׃׋㜥さ 铣׫鴥׿דְתׅ
  12. #FGPSF3Y+BWB儗➿ searchRecipe(“εςʔΩ”, new Callback() { @Override public void onSuccess(List<Recipe> recipes)

    {
 addToList(recipes); } @Override public void onError(Throwable t) { showErrorView(t); } });
 } ⢽ չأذ٦ؗպךٖءؾ׾嗚稊ח㣟侁׃׋㜥さ 铣׫鴥׿דְתׅ
  13. #FGPSF3Y+BWB儗➿ searchRecipe(“εςʔΩ”, new Callback() { @Override public void onSuccess(List<Recipe> recipes)

    {
 addToList(recipes); } @Override public void onError(Throwable t) { showErrorView(t); } });
 } ⢽ չأذ٦ؗպךٖءؾ׾嗚稊ח㣟侁׃׋㜥さ
  14. #FGPSF3Y+BWB儗➿ searchRecipe(“εςʔΩ”, new Callback() { @Override public void onSuccess(List<Recipe> recipes)

    {
 addToList(recipes); } @Override public void onError(Throwable t) { showErrorView(t); } });
 } ⢽ չأذ٦ؗպךٖءؾ׾嗚稊ח㣟侁׃׋㜥さ ٔٗ٦سׅ׷ 铣׫鴥׫ח㣟侁׃ת׃׋ "
  15. 0CTFSWBCMFך⡲׶倯 
 public void searchRecipe(String keyword) {
 recipeApiClient.search(keyword, new Callback()

    { @Override public void onSuccess(List<Recipe> recipes) { } @Override public void onError(Throwable t) { } });
 } 痥✳䒷侧ךDBMMCBDL׾嶊׃גⰻ鿇ד搀せؙٓأ׾⡲׶תׅ
  16. 0CTFSWBCMFך⡲׶倯 
 public void searchRecipe(String keyword) {
 recipeApiClient.search(keyword, new Callback()

    { @Override public void onSuccess(List<Recipe> recipes) { } @Override public void onError(Throwable t) { } });
 } 痥✳䒷侧ךDBMMCBDL׾嶊׃גⰻ鿇ד搀せؙٓأ׾⡲׶תׅ
  17. 0CTFSWBCMFך⡲׶倯 
 public Observable<List<Recipe>> searchRecipe(String keyword) {
 recipeApiClient.search(keyword, new Callback()

    { @Override public void onSuccess(List<Recipe> recipes) {
 } @Override public void onError(Throwable t) {
 } });
 } 鵤׶⦼׾0CTFSWBCMF-JTU3FDJQFח㢌刿׃תׅ ֿך儗挿דכծ؝ٝػ؎ٕؒٓ٦חז׶תׅկ
  18. 0CTFSWBCMFך⡲׶倯 
 public Observable<List<Recipe>> searchRecipe(String keyword) {
 recipeApiClient.search(keyword, new Callback()

    { @Override public void onSuccess(List<Recipe> recipes) {
 } @Override public void onError(Throwable t) {
 } });
 } 鵤׶⦼׾0CTFSWBCMF-JTU3FDJQFח㢌刿׃תׅ ֿך儗挿דכծ؝ٝػ؎ٕؒٓ٦חז׶תׅկ
  19. 0CTFSWBCMFך⡲׶倯 ⰻ鿇ךⳢ椚׾0CTFSWBCMFד⺪׫ת׃׳ֲ public Observable<List<Recipe>> searchRecipe(String keyword) { return Observable.create(subscriber ->

    {
 
 
 
 
 
 
 
 
 
 
 
 }); } void 
 recipeApiClient.search(keyword, new Callback() {
 @Override
 public void onSuccess(List<Recipe> recipes) {
 
 
 } @Override public void onError(Throwable t) {
 }
 }); 0CTFSWBCMFכ؝ٝأزؙٓةָꦀ誊ׁ׸גְ׷ךדծ0CTFSWBCMFDSFBUF穗歋ד؎ٝأةٝأ׾⡲׶תׅկ
  20. 0CTFSWBCMFך⡲׶倯 0CTFSWBCMFך⚥חٗآحؙ׾剅ֹת׃׳ֲ public Observable<List<Recipe>> searchRecipe(String keyword) { return Observable.create(subscriber ->

    {
 recipeApiClient.search(keyword, new Callback() {
 @Override
 public void onSuccess(List<Recipe> recipes) {
 
 
 } @Override public void onError(Throwable t) { 
 } }); }); } void
  21. 0CTFSWBCMFך⡲׶倯 TVCTDSJCFSח؎كٝز׾鸐濼׃ג֮־״ֲ public Observable<List<Recipe>> searchRecipe(String keyword) { return Observable.create(subscriber ->

    {
 recipeApiClient.search(keyword, new Callback() {
 @Override
 public void onSuccess(List<Recipe> recipes) {
 subscriber.onNext(recipes);// イベントの通知 subscriber.onCompleted(); // 全イベントが終了した通知
 } @Override public void onError(Throwable t) { subscriber.onError(t); // 処理内で失敗した通知 } }); }); } void ֿ׸ד0CTFSWBCMF⻉כ㸣䧭דׅկ
  22. 0CTFSWBCMFך⡲׶倯 TVCTDSJCFSח؎كٝز׾鸐濼׃ג֮־״ֲ public Observable<List<Recipe>> searchRecipe(String keyword) { return Observable.create(subscriber ->

    {
 recipeApiClient.search(keyword, new Callback() {
 @Override
 public void onSuccess(List<Recipe> recipes) {
 subscriber.onNext(recipes);// イベントの通知 subscriber.onCompleted(); // 全イベントが終了した通知
 } @Override public void onError(Throwable t) { subscriber.onError(t); // 処理内で失敗した通知 } }); }); } void ֿ׸ד0CTFSWBCMF⻉כ㸣䧭דׅկ
  23. 0CTFSWBCMFך⡲׶倯 TVCTDSJCFSח؎كٝز׾鸐濼׃ג֮־״ֲ public Observable<List<Recipe>> searchRecipe(String keyword) { return Observable.create(subscriber ->

    {
 recipeApiClient.search(keyword, new Callback() {
 @Override
 public void onSuccess(List<Recipe> recipes) {
 subscriber.onNext(recipes);// イベントの通知 subscriber.onCompleted(); // 全イベントが終了した通知
 } @Override public void onError(Throwable t) { subscriber.onError(t); // 処理内で失敗した通知 } }); }); } void ֿ׸ד0CTFSWBCMF⻉כ㸣䧭דׅկ
  24. ず劍ًاحسך0CTFSWBCMF⻉ public List<Recipe> searchRecipe(String keyword) throws HttpException { // okhttpͱ͔HttpClientͰಉظ௨৴


    } 
 public Observable<List<Recipe>> searchRecipe(String keyword) { return Observable.create(subscriber -> { try{
 List<Recipe> recipes = ApiClient.search(keyword); subscriber.onNext(recipes); subscriber.onFinished(); } catch(HttpException e) {
 subscriber.onError(e);
 } } ⡭锑 ず劍ًاحس׾0CTFSWBCMF⻉ׅ׷㜥さ 搀꼽זأٖحس欰䧭׾鼘ֽ׷׋׭חծ0CTFSWBCMFך⚥魦כ⳿勻׷ꣲ׶ず劍Ⳣ椚ח׃ת׃׳ֲկ
  25. 3Y+BWB㼪Ⰵך㛇燉 searchRecipe(“εςʔΩ”) .subscribe(new Subscriber<List<Recipe>>() {
 @Override
 public void onNext(List<Recipe> recipe)

    {
 addToList(recipes);
 }
 @Override
 public void onError(Throwable e) {
 showErrorMessage(t);
 }
 
 @Override
 public void onCompleted() { 
 }); ); ⢽ չأذ٦ؗպךٖءؾ׾嗚稊׃גٔأزח鷄⸇ 3Y晛 铣׫鴥׿דְתׅ
  26. 3Y+BWB㼪Ⰵך㛇燉 searchRecipe(“εςʔΩ”) .subscribe(new Subscriber<List<Recipe>>() {
 @Override
 public void onNext(List<Recipe> recipe)

    {
 addToList(recipes);
 }
 @Override
 public void onError(Throwable e) {
 showErrorMessage(t);
 }
 
 @Override
 public void onCompleted() { 
 }); ); ⢽ չأذ٦ؗպךٖءؾ׾嗚稊׃גٔأزח鷄⸇ 3Y晛 铣׫鴥׿דְתׅ
  27. 3Y+BWB㼪Ⰵך㛇燉 searchRecipe(“εςʔΩ”) .subscribe(new Subscriber<List<Recipe>>() {
 @Override
 public void onNext(List<Recipe> recipe)

    {
 addToList(recipes);
 }
 @Override
 public void onError(Throwable e) {
 showErrorMessage(t);
 }
 
 @Override
 public void onCompleted() { 
 }); ); ⢽ չأذ٦ؗպךٖءؾ׾嗚稊׃גٔأزח鷄⸇ 3Y晛 铣׫鴥׿דְתׅ
  28. 3Y+BWB㼪Ⰵך㛇燉 searchRecipe(“εςʔΩ”) .subscribe(new Subscriber<List<Recipe>>() {
 @Override
 public void onNext(List<Recipe> recipe)

    {
 addToList(recipes);
 }
 @Override
 public void onError(Throwable e) {
 showErrorMessage(t);
 }
 
 @Override
 public void onCompleted() { 
 }); ); ⢽ չأذ٦ؗպךٖءؾ׾嗚稊׃גٔأزח鷄⸇ 3Y晛
  29. 3Y+BWB㼪Ⰵך㛇燉 searchRecipe(“εςʔΩ”) .subscribe(new Subscriber<List<Recipe>>() {
 @Override
 public void onNext(List<Recipe> recipe)

    {
 addToList(recipes);
 }
 @Override
 public void onError(Throwable e) {
 showErrorMessage(t);
 }
 
 @Override
 public void onCompleted() { 
 }); ); ⢽ չأذ٦ؗպךٖءؾ׾嗚稊׃גٔأزח鷄⸇ 3Y晛 !
  30. 3Y+BWB㼪Ⰵך㛇燉 searchRecipe(“εςʔΩ”) .subscribe(new Subscriber<List<Recipe>>() {
 @Override
 public void onNext(List<Recipe> recipe)

    {
 addToList(recipes);
 }
 @Override
 public void onError(Throwable e) {
 showErrorMessage(t);
 }
 
 @Override
 public void onCompleted() { 
 }); ); ⢽ չأذ٦ؗպךٖءؾ׾嗚稊׃גٔأزח鷄⸇ 3Y晛 ! !
  31. 3Y+BWB㼪Ⰵך㛇燉 searchRecipe(“εςʔΩ”) .subscribe(new Subscriber<List<Recipe>>() {
 @Override
 public void onNext(List<Recipe> recipe)

    {
 addToList(recipes);
 }
 @Override
 public void onError(Throwable e) {
 showErrorMessage(t);
 }
 
 @Override
 public void onCompleted() { 
 }); ); ⢽ չأذ٦ؗպךٖءؾ׾嗚稊׃גٔأزח鷄⸇ 3Y晛 ! ! !
  32. 3Y+BWB㼪Ⰵך㛇燉 searchRecipe(“εςʔΩ”) .subscribe(new Subscriber<List<Recipe>>() {
 @Override
 public void onNext(List<Recipe> recipe)

    {
 addToList(recipes);
 }
 @Override
 public void onError(Throwable e) {
 showErrorMessage(t);
 }
 
 @Override
 public void onCompleted() { 
 }); ); ⢽ չأذ٦ؗպךٖءؾ׾嗚稊׃גٔأزח鷄⸇ 3Y晛 ! ! ! !
  33. -BNCEB׾ⵃ欽׃׋㜥さ searchRecipe(“εςʔΩ”) .subscribe(recipes -> { addToList(recipes); }, throwable -> {

    showErrorMessage(t); }, () -> {
 // লུՄೳ
 } ); 0CTFSWBCMFTVCTDSJCF חכٓيت䒭׾床ֿׅה׮⳿勻׷ 铣׫鴥׿דְתׅ +BWBָ⢪ִ׷橆㞮ד֮׸לծSYGVODUJPOT"DUJPOהSYGVODUJPOT"DUJPOָٓيتח㢌䳔דֹתׅկ
  34. -BNCEB׾ⵃ欽׃׋㜥さ searchRecipe(“εςʔΩ”) .subscribe(recipes -> { addToList(recipes); }, throwable -> {

    showErrorMessage(t); }, () -> {
 // লུՄೳ
 } ); 0CTFSWBCMFTVCTDSJCF חכٓيت䒭׾床ֿׅה׮⳿勻׷ 铣׫鴥׿דְתׅ +BWBָ⢪ִ׷橆㞮ד֮׸לծSYGVODUJPOT"DUJPOהSYGVODUJPOT"DUJPOָٓيتח㢌䳔דֹתׅկ
  35. -BNCEB׾ⵃ欽׃׋㜥さ searchRecipe(“εςʔΩ”) .subscribe(recipes -> { addToList(recipes); }, throwable -> {

    showErrorMessage(t); }, () -> {
 // লུՄೳ
 } ); 0CTFSWBCMFTVCTDSJCF חכٓيت䒭׾床ֿׅה׮⳿勻׷ +BWBָ⢪ִ׷橆㞮ד֮׸לծSYGVODUJPOT"DUJPOהSYGVODUJPOT"DUJPOָٓيتח㢌䳔דֹתׅկ
  36. -BNCEB׾ⵃ欽׃׋㜥さ searchRecipe(“εςʔΩ”) .subscribe(recipes -> { addToList(recipes); }, throwable -> {

    showErrorMessage(t); }, () -> {
 // লུՄೳ
 } ); 0CTFSWBCMFTVCTDSJCF חכٓيت䒭׾床ֿׅה׮⳿勻׷ ! ! ! ! +BWBָ⢪ִ׷橆㞮ד֮׸לծSYGVODUJPOT"DUJPOהSYGVODUJPOT"DUJPOָٓيتח㢌䳔דֹתׅկ
  37. 0CTFSWBCMFTVCTDSJCF0O 0CTFSWBCMFTVCTDSJCF0Oחאְג searchRecipeBy(“εςʔΩ”)
 .map(recipes -> { /* todo something */

    })
 .subscribeOn(Schedulers.io())
 .map(recipes -> { /* todo something */ }) .subscribe(recipes -> {});  0CTFSWBCMFⰋ⡤ך㹋遤أٖحس׾䭷㹀ׅ׷ؔلٖ٦ة٦  וֿד䭷㹀׃ג׮ꟼ⤘זְ  醱侧㔐䭷㹀ׁ׸׋㜥さכծ♧殢♳ד䭷㹀ׁ׸׋׮ךָ黝䘔ׁ׸׷
  38. 0CTFSWBCMFTVCTDSJCF0O 0CTFSWBCMFTVCTDSJCF0Oחאְג searchRecipeBy(“εςʔΩ”)
 .map(recipes -> { /* todo something */

    })
 .subscribeOn(Schedulers.io())
 .map(recipes -> { /* todo something */ }) .subscribe(recipes -> {});  0CTFSWBCMFⰋ⡤ך㹋遤أٖحس׾䭷㹀ׅ׷ؔلٖ٦ة٦  וֿד䭷㹀׃ג׮ꟼ⤘זְ  醱侧㔐䭷㹀ׁ׸׋㜥さכծ♧殢♳ד䭷㹀ׁ׸׋׮ךָ黝䘔ׁ׸׷ 4DIFEVMFSTJP כ♳ꣲךזְأٖحسف٦ַٕ׵أٖحس׾ⶴ׶䔲גגֻ׸תׅկ ⰋגךⳢ椚ָTDIFEVMFSTJP ָⶴ׶䮶׷
 ٙ٦ؕ٦أٖحسד㹋遤ׁ׸׷
  39. 0CTFSWBCMFPCTFSWF0O 0CTFSWBCMFPCTFSWF0Oחאְג searchRecipeBy(“εςʔΩ”)
 .map(recipes -> { /* todo something */

    })
 .subscribeOn(Schedulers.io())
 .observeOn(AndroidSchedulers.mainThread())
 .map(recipes -> { /* todo something */ }) .observeOn(Schedulers.io()) .subscribe(recipes -> {});  0CTFSWBCMFַ׵ちֹ⳿ׁ׸׋⦼׾「ֽ《׷أٖحس׾ⴖ׶剏ִ׷  䭷㹀ׁ׸׋皘䨽״׶♴ךؔلٖ٦ة٦ךأٖحسָ㢌刿ׁ׸׷  ًاحسثؑ٦ٝך⚥ד醱侧㔐ㄎן⳿ֿׅה׮⳿勻׷
  40. 0CTFSWBCMFPCTFSWF0O 0CTFSWBCMFPCTFSWF0Oחאְג searchRecipeBy(“εςʔΩ”)
 .map(recipes -> { /* todo something */

    })
 .subscribeOn(Schedulers.io())
 .observeOn(AndroidSchedulers.mainThread())
 .map(recipes -> { /* todo something */ }) .observeOn(Schedulers.io()) .subscribe(recipes -> {});  0CTFSWBCMFַ׵ちֹ⳿ׁ׸׋⦼׾「ֽ《׷أٖحس׾ⴖ׶剏ִ׷  䭷㹀ׁ׸׋皘䨽״׶♴ךؔلٖ٦ة٦ךأٖحسָ㢌刿ׁ׸׷  ًاحسثؑ٦ٝך⚥ד醱侧㔐ㄎן⳿ֿׅה׮⳿勻׷ ٙ٦ؕ٦أٖحس  ד㹋遤ׁ׸׷ 6*أٖحسד㹋遤ׁ׸׷ ٙ٦ؕ٦أٖحس  ד㹋遤ׁ׸׷ ➭ךꟚ涪罏ָ幉✉׃ַיזְךדծPCTFSWF0O׾醱侧㔐ㄎעךכ֮ת׶⢪ְ׋ֻזְדׅיկ
  41. 4DIFEVMFSⵃ欽儗ךذٝفٖ 4DIFEVMFSך䭷㹀ך״ֻ֮׷ػة٦ٝ searchRecipeBy(“εςʔΩ”)
 .map(recipes -> { /* todo something */

    })
 .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(recipes -> {}); 0CTFSWBCMF⿹ןNBQזוךؔلٖ٦ة٦ָٙ٦ؕ٦أٖحسד㹋遤ׁ׸ծ
 TVCTDSJCFח床׃׋4VCTDSJCFS "DUJPO ָ6*أٖحسד㹋遤ׁ׸תׅկ
  42. 3Y+BWB㼪Ⰵך㛇燉 searchRecipe(“εςʔΩ”)
 .subscribeOn(schedulers.io())
 .observeOn(AndroidSchedulers.mainThread()) .subscribe(recipes -> { addToList(recipes); }, throwable

    -> { showErrorMessage(t); } ); ٖءؾ嗚稊ך㹋鄲ח4DIFEVMFSך䭷㹀׾鎸鶢 铣׫鴥׿דְתׅ ֿ׸דծ0CTFSWBCMF⻉ ׉ךㄎ⳿׃תדָ姻׃ֻ遤׻׸׷״ֲחז׶ת׃׋կ
  43. 3Y+BWB㼪Ⰵך㛇燉 searchRecipe(“εςʔΩ”)
 .subscribeOn(schedulers.io())
 .observeOn(AndroidSchedulers.mainThread()) .subscribe(recipes -> { addToList(recipes); }, throwable

    -> { showErrorMessage(t); } ); ٖءؾ嗚稊ך㹋鄲ח4DIFEVMFSך䭷㹀׾鎸鶢 铣׫鴥׿דְתׅ ֿ׸דծ0CTFSWBCMF⻉ ׉ךㄎ⳿׃תדָ姻׃ֻ遤׻׸׷״ֲחז׶ת׃׋կ
  44. 3Y+BWB㼪Ⰵך㛇燉 searchRecipe(“εςʔΩ”)
 .subscribeOn(schedulers.io())
 .observeOn(AndroidSchedulers.mainThread()) .subscribe(recipes -> { addToList(recipes); }, throwable

    -> { showErrorMessage(t); } ); ٖءؾ嗚稊ך㹋鄲ח4DIFEVMFSך䭷㹀׾鎸鶢 ֿ׸דծ0CTFSWBCMF⻉ ׉ךㄎ⳿׃תדָ姻׃ֻ遤׻׸׷״ֲחז׶ת׃׋կ
  45. 3Y+BWB㼪Ⰵך㛇燉 searchRecipe(“εςʔΩ”)
 .subscribeOn(schedulers.io())
 .observeOn(AndroidSchedulers.mainThread()) .subscribe(recipes -> { addToList(recipes); }, throwable

    -> { showErrorMessage(t); } ); ٖءؾ嗚稊ך㹋鄲ח4DIFEVMFSך䭷㹀׾鎸鶢 ! ! ! ! ֿ׸דծ0CTFSWBCMF⻉ ׉ךㄎ⳿׃תדָ姻׃ֻ遤׻׸׷״ֲחז׶ת׃׋կ
  46. HFU"DUJWJUZOVMM㉏겗 searchRecipeBy(“ϋϯόʔά”, new Callback() { @Override public void onSuccess(List<Recipe> recipes)

    {
 if(getActivity() == null) { return; }
 addToList(recipes); } @Override public void onError(Throwable t) {
 if(getActivity() == null) { return; } showErrorMessage(t); } });
 } HFU"DUJWJUZ OVMM㉏겗ח㼎䘔 ꬊず劍؝٦ٕغحؙ晛
  47. HFU"DUJWJUZOVMM㉏겗 searchRecipeBy(“ϋϯόʔά”) .compose(bindToLifecycle())
 .subscribeOn(schedulers.io())
 .observeOn(AndroidSchedulers.mainThread()) .subscribe(recipes -> { addList(recipes); },

    throwable -> { showErrorMessage(t); } ); HFU"DUJWJUZ OVMM㉏겗ח㼎䘔 3Y晛 3Y"DUJWJUZ׾竰䪫ׅ׷䗳銲ָ֮׶תָׅծ傀㶷ך#BTF"DUJWJUZח穈׫鴥׬ֿה׮㺁僒דׅկ 铣׫鴥׿דְתׅ
  48. HFU"DUJWJUZOVMM㉏겗 searchRecipeBy(“ϋϯόʔά”) .compose(bindToLifecycle())
 .subscribeOn(schedulers.io())
 .observeOn(AndroidSchedulers.mainThread()) .subscribe(recipes -> { addList(recipes); },

    throwable -> { showErrorMessage(t); } ); HFU"DUJWJUZ OVMM㉏겗ח㼎䘔 3Y晛 3Y"DUJWJUZ׾竰䪫ׅ׷䗳銲ָ֮׶תָׅծ傀㶷ך#BTF"DUJWJUZח穈׫鴥׬ֿה׮㺁僒דׅկ 铣׫鴥׿דְתׅ
  49. HFU"DUJWJUZOVMM㉏겗 searchRecipeBy(“ϋϯόʔά”) .compose(bindToLifecycle())
 .subscribeOn(schedulers.io())
 .observeOn(AndroidSchedulers.mainThread()) .subscribe(recipes -> { addList(recipes); },

    throwable -> { showErrorMessage(t); } ); HFU"DUJWJUZ OVMM㉏겗ח㼎䘔 3Y晛 3Y"DUJWJUZ׾竰䪫ׅ׷䗳銲ָ֮׶תָׅծ傀㶷ך#BTF"DUJWJUZח穈׫鴥׬ֿה׮㺁僒דׅկ
  50. HFU"DUJWJUZOVMM㉏겗 searchRecipeBy(“ϋϯόʔά”) .compose(bindToLifecycle())
 .subscribeOn(schedulers.io())
 .observeOn(AndroidSchedulers.mainThread()) .subscribe(recipes -> { addList(recipes); },

    throwable -> { showErrorMessage(t); } ); HFU"DUJWJUZ OVMM㉏겗ח㼎䘔 3Y晛 3Y"DUJWJUZ׾竰䪫ׅ׷䗳銲ָ֮׶תָׅծ傀㶷ך#BTF"DUJWJUZח穈׫鴥׬ֿה׮㺁僒דׅկ ! ! ! !
  51. HFU"DUJWJUZOVMM㉏겗 searchRecipeBy(“ϋϯόʔά”) .compose(bindToLifecycle())
 .subscribeOn(schedulers.io())
 .observeOn(AndroidSchedulers.mainThread()) .subscribe(recipes -> { addList(recipes); },

    throwable -> { showErrorMessage(t); } ); ׮׃ծٖءؾ嗚稊穠卓ָ鵤׏גֻ׷⵸ח歗꬗ָ䨱׏גְ׋׵ծ 铣׫鴥׿דְתׅ 3Y"DUJWJUZ׾竰䪫ׅ׷䗳銲ָ֮׶תָׅծ傀㶷ך#BTF"DUJWJUZח穈׫鴥׬ֿה׮㺁僒דׅկ
  52. HFU"DUJWJUZOVMM㉏겗 searchRecipeBy(“ϋϯόʔά”) .compose(bindToLifecycle())
 .subscribeOn(schedulers.io())
 .observeOn(AndroidSchedulers.mainThread()) .subscribe(recipes -> { addList(recipes); },

    throwable -> { showErrorMessage(t); } ); ׮׃ծٖءؾ嗚稊穠卓ָ鵤׏גֻ׷⵸ח歗꬗ָ䨱׏גְ׋׵ծ 3Y"DUJWJUZ׾竰䪫ׅ׷䗳銲ָ֮׶תָׅծ傀㶷ך#BTF"DUJWJUZח穈׫鴥׬ֿה׮㺁僒דׅկ
  53. HFU"DUJWJUZOVMM㉏겗 searchRecipeBy(“ϋϯόʔά”) .compose(bindToLifecycle())
 .subscribeOn(schedulers.io())
 .observeOn(AndroidSchedulers.mainThread()) .subscribe(recipes -> { addList(recipes); },

    throwable -> { showErrorMessage(t); } ); ׮׃ծٖءؾ嗚稊穠卓ָ鵤׏גֻ׷⵸ח歗꬗ָ䨱׏גְ׋׵ծ מהא⵸ך歗꬗ָ
 邌爙ׁ׸גְ׷ 3Y"DUJWJUZ׾竰䪫ׅ׷䗳銲ָ֮׶תָׅծ傀㶷ך#BTF"DUJWJUZח穈׫鴥׬ֿה׮㺁僒דׅկ
  54. HFU"DUJWJUZOVMM㉏겗 searchRecipeBy(“ϋϯόʔά”) .compose(bindToLifecycle())
 .subscribeOn(schedulers.io())
 .observeOn(AndroidSchedulers.mainThread()) .subscribe(recipes -> { addList(recipes); },

    throwable -> { showErrorMessage(t); } ); ׮׃ծٖءؾ嗚稊穠卓ָ鵤׏גֻ׷⵸ח歗꬗ָ䨱׏גְ׋׵ծ מהא⵸ך歗꬗ָ
 邌爙ׁ׸גְ׷ Y TVCTDSJCFⰻךⳢ椚כㄎל׸זְ 3Y"DUJWJUZ׾竰䪫ׅ׷䗳銲ָ֮׶תָׅծ傀㶷ך#BTF"DUJWJUZח穈׫鴥׬ֿה׮㺁僒דׅկ
  55. 3Y+BWBדך䖉׍さ׻ׇⳢ椚 DPNCJOF-BUFTU 0CTFSWBCMF 0CTFSWBCMF 'VOD 3Y+BWBדך⚛⴨Ⳣ椚 Observable.combineLatest(
 Observable.just(1),
 Observable.just(2),
 (i1,i2)

    -> i1 + i2 // ͜ͷ৔߹ɺ3͕࣍ͷΦϖϨʔλʔʹ౉Δ
 ); אך0CTFSWBCMFךⳢ椚׾䖉׍ծ「ֽ《׏׋⦼׾'VODד⦼׾さ䧭ׅ׷ؔلٖ٦ة٦
  56. 3Y+BWBדך⚛⴨Ⳣ椚 Observable.combineLatest(
 Observable.just(1),
 Observable.just(2),
 (i1,i2) -> Pair.create(i1, i2)
 ); Observable.combineLatest(


    Observable.just(1),
 Observable.just(2),
 Pair::create
 ); DPNCJOF-BUFTUה1BJS׾⢪׏׋䖉׍さ׻ׇⳢ椚 ٓيت䒭ך䒷侧הًاحسך⟎䒷侧ָ♧荜׃׋㜥さחכծ♴ך״ֲחًاحسٔؿ؋ٖٝأהְֲ俑岀ָ⢪ִ׷կ
  57. 嗚稊歗꬗ך㹋鄲ךⰋ⡤⫷ Observable.combineLatest( searchRecipe(“εςʔΩ”), searchAd(“εςʔΩ”), // ޿ࠂ৘ใΛऔಘ͢ΔϝιουͩͱࢥͬͯԼ͍͞ Pair::create )
 .subscribeOn(schedulers.io())
 .observeOn(AndroidSchedulers.mainThread())

    .subscribe(pair -> { addToListWithBannerIfExist(pair.first, pair.second); }, throwable -> { showErrorMessage(t); } ); ⢽ չأذ٦ؗպךٖءؾ׾嗚稊 ꟼ鸬䎢デך嗚稊 DPNCJOF-BUFTUך➿׻׶ח[JQؔلٖ٦ة٦׾⢪ֲֿה׮⳿勻תׅկ
  58. 嗚稊歗꬗ך㹋鄲ךⰋ⡤⫷ Observable.combineLatest( searchRecipe(“εςʔΩ”), searchAd(“εςʔΩ”), // ޿ࠂ৘ใΛऔಘ͢ΔϝιουͩͱࢥͬͯԼ͍͞ Pair::create )
 .subscribeOn(schedulers.io())
 .observeOn(AndroidSchedulers.mainThread())

    .subscribe(pair -> { addToListWithBannerIfExist(pair.first, pair.second); }, throwable -> { showErrorMessage(t); } ); ⢽ չأذ٦ؗպךٖءؾ׾嗚稊 ꟼ鸬䎢デך嗚稊 DPNCJOF-BUFTUך➿׻׶ח[JQؔلٖ٦ة٦׾⢪ֲֿה׮⳿勻תׅկ
  59. 嗚稊歗꬗ך㹋鄲ךⰋ⡤⫷ Observable.combineLatest( searchRecipe(“εςʔΩ”), searchAd(“εςʔΩ”), // ޿ࠂ৘ใΛऔಘ͢ΔϝιουͩͱࢥͬͯԼ͍͞ Pair::create )
 .subscribeOn(schedulers.io())
 .observeOn(AndroidSchedulers.mainThread())

    .subscribe(pair -> { addToListWithBannerIfExist(pair.first, pair.second); }, throwable -> { showErrorMessage(t); } ); ⢽ չأذ٦ؗպךٖءؾ׾嗚稊 ꟼ鸬䎢デך嗚稊 DPNCJOF-BUFTUך➿׻׶ח[JQؔلٖ٦ة٦׾⢪ֲֿה׮⳿勻תׅկ
  60. 嗚稊歗꬗ך㹋鄲ךⰋ⡤⫷ Observable.combineLatest( searchRecipe(“εςʔΩ”), searchAd(“εςʔΩ”), // ޿ࠂ৘ใΛऔಘ͢ΔϝιουͩͱࢥͬͯԼ͍͞ Pair::create )
 .subscribeOn(schedulers.io())
 .observeOn(AndroidSchedulers.mainThread())

    .subscribe(pair -> { addToListWithBannerIfExist(pair.first, pair.second); }, throwable -> { showErrorMessage(t); } ); ⢽ չأذ٦ؗպךٖءؾ׾嗚稊 ꟼ鸬䎢デך嗚稊 DPNCJOF-BUFTUך➿׻׶ח[JQؔلٖ٦ة٦׾⢪ֲֿה׮⳿勻תׅկ
  61. 嗚稊歗꬗ך㹋鄲ךⰋ⡤⫷ Observable.combineLatest( searchRecipe(“εςʔΩ”), searchAd(“εςʔΩ”), // ޿ࠂ৘ใΛऔಘ͢ΔϝιουͩͱࢥͬͯԼ͍͞ Pair::create )
 .subscribeOn(schedulers.io())
 .observeOn(AndroidSchedulers.mainThread())

    .subscribe(pair -> { addToListWithBannerIfExist(pair.first, pair.second); }, throwable -> { showErrorMessage(t); } ); ⢽ չأذ٦ؗպךٖءؾ׾嗚稊 ꟼ鸬䎢デך嗚稊 DPNCJOF-BUFTUך➿׻׶ח[JQؔلٖ٦ة٦׾⢪ֲֿה׮⳿勻תׅկ
  62. 嗚稊歗꬗ך㹋鄲ךⰋ⡤⫷ Observable.combineLatest( searchRecipe(“εςʔΩ”), searchAd(“εςʔΩ”), // ޿ࠂ৘ใΛऔಘ͢ΔϝιουͩͱࢥͬͯԼ͍͞ Pair::create )
 .subscribeOn(schedulers.io())
 .observeOn(AndroidSchedulers.mainThread())

    .subscribe(pair -> { addToListWithBannerIfExist(pair.first, pair.second); }, throwable -> { showErrorMessage(t); } ); ⢽ չأذ٦ؗպךٖءؾ׾嗚稊 ꟼ鸬䎢デך嗚稊 ٖءؾךٔأز DPNCJOF-BUFTUך➿׻׶ח[JQؔلٖ٦ة٦׾⢪ֲֿה׮⳿勻תׅկ
  63. 嗚稊歗꬗ך㹋鄲ךⰋ⡤⫷ Observable.combineLatest( searchRecipe(“εςʔΩ”), searchAd(“εςʔΩ”), // ޿ࠂ৘ใΛऔಘ͢ΔϝιουͩͱࢥͬͯԼ͍͞ Pair::create )
 .subscribeOn(schedulers.io())
 .observeOn(AndroidSchedulers.mainThread())

    .subscribe(pair -> { addToListWithBannerIfExist(pair.first, pair.second); }, throwable -> { showErrorMessage(t); } ); ⢽ չأذ٦ؗպךٖءؾ׾嗚稊 ꟼ鸬䎢デך嗚稊 ٖءؾךٔأز DPNCJOF-BUFTUך➿׻׶ח[JQؔلٖ٦ة٦׾⢪ֲֿה׮⳿勻תׅկ
  64. 嗚稊歗꬗ך㹋鄲ךⰋ⡤⫷ Observable.combineLatest( searchRecipe(“εςʔΩ”), searchAd(“εςʔΩ”), // ޿ࠂ৘ใΛऔಘ͢ΔϝιουͩͱࢥͬͯԼ͍͞ Pair::create )
 .subscribeOn(schedulers.io())
 .observeOn(AndroidSchedulers.mainThread())

    .subscribe(pair -> { addToListWithBannerIfExist(pair.first, pair.second); }, throwable -> { showErrorMessage(t); } ); ⢽ չأذ٦ؗպךٖءؾ׾嗚稊 ꟼ鸬䎢デך嗚稊 ٖءؾךٔأز 䎢デך䞔㜠 DPNCJOF-BUFTUך➿׻׶ח[JQؔلٖ٦ة٦׾⢪ֲֿה׮⳿勻תׅկ
  65. 3Y+BWBדךؒٓ٦Ⳣ椚 PO&SSPS3FUVSO 'VOD5ISPXBCMF  FYUFOET5 3Y+BWBדךؒٓ٦Ⳣ椚  AdObservable(“λϚΰ”) .onErrorReturn(throwable ->

    AdModel.EmptyData()); PO&SSPS3FUVSO׾㹀纏ׅ׷ֿהדծ4VCTDSJCFSחFSSPSָ鸐濼ׁ׸זֻז׶תׅկ
  66. 䎢デ׾《䖤ׅ׷0CTFSWBCMF׾何葺ׅ׷  public Observable<AdModel> searchAd(String keyword) { return Observable.create(subscriber ->

    { try{
 AdModel adModel = adClient.search(keyword); subscriber.onNext(adModel); } catch(HttpException e) {
 subscriber.onError(e);
 }) .onErrorReturn(e -> { return AdModel.createEmptyData();
 }); } 䎢デ׾嗚稊ׅ׷0CTFSWBCMFחؒٓ٦Ⳣ椚׾鷄⸇ׅ׷
  67. 䎢デ׾《䖤ׅ׷0CTFSWBCMF׾何葺ׅ׷  public Observable<AdModel> searchAd(String keyword) { return Observable.create(subscriber ->

    { try{
 AdModel adModel = adClient.search(keyword); subscriber.onNext(adModel); } catch(HttpException e) {
 subscriber.onError(e);
 }) .onErrorReturn(e -> { return AdModel.createEmptyData();
 }); } 䎢デ׾嗚稊ׅ׷0CTFSWBCMFחؒٓ٦Ⳣ椚׾鷄⸇ׅ׷
  68. 䎢デ׾《䖤ׅ׷0CTFSWBCMF׾何葺ׅ׷  public Observable<AdModel> searchAd(String keyword) { return Observable.create(subscriber ->

    { try{
 AdModel adModel = adClient.search(keyword); subscriber.onNext(adModel); } catch(HttpException e) {
 subscriber.onError(e);
 }) .onErrorReturn(e -> { return AdModel.createEmptyData();
 }); } 䎢デ׾嗚稊ׅ׷0CTFSWBCMFחؒٓ٦Ⳣ椚׾鷄⸇ׅ׷
  69. 䎢デ׾《䖤ׅ׷0CTFSWBCMF׾何葺ׅ׷  public Observable<AdModel> searchAd(String keyword) { return Observable.create(subscriber ->

    { try{
 AdModel adModel = adClient.search(keyword); subscriber.onNext(adModel); } catch(HttpException e) {
 subscriber.onError(e);
 }) .onErrorReturn(e -> { return AdModel.createEmptyData();
 }); } 䎢デ׾嗚稊ׅ׷0CTFSWBCMFחؒٓ٦Ⳣ椚׾鷄⸇ׅ׷ ⢽㢩ָ涪欰׃׋㜥さַ׵ך瑞ךر٦ة٦׾鵤ׅ
  70. 䎢デ׾《䖤ׅ׷0CTFSWBCMF׾何葺ׅ׷  public Observable<AdModel> searchAd(String keyword) { return Observable.create(subscriber ->

    { try{
 AdModel adModel = adClient.search(keyword); subscriber.onNext(adModel); } catch(HttpException e) {
 subscriber.onError(e);
 }) .onErrorReturn(e -> { return AdModel.createEmptyData();
 }); } 䎢デ׾嗚稊ׅ׷0CTFSWBCMFחؒٓ٦Ⳣ椚׾鷄⸇ׅ׷ ⢽㢩ָ涪欰׃׋㜥さַ׵ך瑞ךر٦ة٦׾鵤ׅ PO&SSPSָㄎל׸זֻז׶ծPO/FYUח瑞ך䎢デ䞔㜠ָ床׷״ֲחז׷
  71. 嗚稊歗꬗ך㹋鄲ךⰋ⡤⫷ Observable.combineLatest( searchRecipe(“εςʔΩ”), searchAd(“εςʔΩ”), Pair::create )
 .subscribeOn(schedulers.io())
 .observeOn(AndroidSchedulers.mainThread()) .subscribe( /*

    লུ */ ); ⚛⴨Ⳣ椚ׅ׷0CTFSWBCMFך㹋遤أٖحسך㉏겗 ˖ TFBSDI3FDJQF הTFBSDI"E כTVCTDSJCF0Oָ劢䭷㹀ך朐䡾կ ˖ ֿך㜥さDPNCJOF-BUJTUך⚥魦כ♧אךأٖحسד㹋遤ׁ׸׷կ DPNCJOF-BUJTUכ⚛⴨Ⳣ椚׃׋ְָծأٖحسָـٗحׁؙ׸גְג⚛⴨Ⳣ椚חז׵זְ✲ָ֮׶תׅկ
  72. 嗚稊歗꬗ך㹋鄲ךⰋ⡤⫷ Observable.combineLatest( searchRecipe(“εςʔΩ”), searchAd(“εςʔΩ”), Pair::create )
 .subscribeOn(schedulers.io())
 .observeOn(AndroidSchedulers.mainThread()) .subscribe( /*

    লུ */ ); ⚛⴨Ⳣ椚ׅ׷0CTFSWBCMFך㹋遤أٖحسך㉏겗 ˖ TFBSDI3FDJQF הTFBSDI"E כTVCTDSJCF0Oָ劢䭷㹀ך朐䡾կ ˖ ֿך㜥さDPNCJOF-BUJTUך⚥魦כ♧אךأٖحسד㹋遤ׁ׸׷կ DPNCJOF-BUJTUכ⚛⴨Ⳣ椚׃׋ְָծأٖحسָـٗحׁؙ׸גְג⚛⴨Ⳣ椚חז׵זְ✲ָ֮׶תׅկ
  73. 嗚稊歗꬗ך㹋鄲ךⰋ⡤⫷ Observable.combineLatest( searchRecipe(“εςʔΩ”), searchAd(“εςʔΩ”), Pair::create )
 .subscribeOn(schedulers.io())
 .observeOn(AndroidSchedulers.mainThread()) .subscribe( /*

    লུ */ ); ⚛⴨Ⳣ椚ׅ׷0CTFSWBCMFך㹋遤أٖحسך㉏겗 ˖ TFBSDI3FDJQF הTFBSDI"E כTVCTDSJCF0Oָ劢䭷㹀ך朐䡾կ ˖ ֿך㜥さDPNCJOF-BUJTUך⚥魦כ♧אךأٖحسד㹋遤ׁ׸׷կ DPNCJOF-BUJTUכ⚛⴨Ⳣ椚׃׋ְָծأٖحسָـٗحׁؙ׸גְג⚛⴨Ⳣ椚חז׵זְ✲ָ֮׶תׅկ
  74. 嗚稊歗꬗ך㹋鄲ךⰋ⡤⫷ Observable.combineLatest( searchRecipe(“εςʔΩ”), searchAd(“εςʔΩ”), Pair::create )
 .subscribeOn(schedulers.io())
 .observeOn(AndroidSchedulers.mainThread()) .subscribe( /*

    লུ */ ); ⚛⴨Ⳣ椚ׅ׷0CTFSWBCMFך㹋遤أٖحسך㉏겗 ˖ TFBSDI3FDJQF הTFBSDI"E כTVCTDSJCF0Oָ劢䭷㹀ך朐䡾կ ˖ ֿך㜥さDPNCJOF-BUJTUך⚥魦כ♧אךأٖحسד㹋遤ׁ׸׷կ DPNCJOF-BUJTUכ⚛⴨Ⳣ椚׃׋ְָծأٖحسָـٗحׁؙ׸גְג⚛⴨Ⳣ椚חז׵זְ✲ָ֮׶תׅկ
  75. 嗚稊歗꬗ך㹋鄲ךⰋ⡤⫷ Observable.combineLatest( searchRecipe(“εςʔΩ”), searchAd(“εςʔΩ”), Pair::create )
 .subscribeOn(schedulers.io())
 .observeOn(AndroidSchedulers.mainThread()) .subscribe( /*

    লུ */ ); ⚛⴨Ⳣ椚ׅ׷0CTFSWBCMFך㹋遤أٖحسך㉏겗 ˖ TFBSDI3FDJQF הTFBSDI"E כTVCTDSJCF0Oָ劢䭷㹀ך朐䡾կ ˖ ֿך㜥さDPNCJOF-BUJTUך⚥魦כ♧אךأٖحسד㹋遤ׁ׸׷կ TFBSDI3FDJQFךⳢ椚ָ穄✪׃׋䖓ח㹋遤ׁ׸׷ DPNCJOF-BUJTUכ⚛⴨Ⳣ椚׃׋ְָծأٖحسָـٗحׁؙ׸גְג⚛⴨Ⳣ椚חז׵זְ✲ָ֮׶תׅկ
  76. 嗚稊歗꬗ך㹋鄲ךⰋ⡤⫷ Observable.combineLatest( searchRecipe(“εςʔΩ”).subscribeOn(schedulers.io()), searchAd(“εςʔΩ”).subscribeOn(schedulers.io()), Pair::create )
 .subscribeOn(schedulers.io())
 .observeOn(AndroidSchedulers.mainThread()) .subscribe( /*

    লུ */ ); ⚛⴨Ⳣ椚ׅ׷0CTFSWBCMFך㹋遤أٖحسך㉏겗 ⚥魦ך0CTFSWBCMFח׮TVCTDSJCF0O׾䭷㹀׃גծ׉׸׊׸חⴽأٖحس׾ⶴ׶䔲ג׷ DPNCJOF-BUJTUך⚥魦ָ⚛⴨Ⳣ椚ׁ׸׷״ֲחז׏׋կ
  77. 3Y+BWBדךؒٓ٦Ⳣ椚  SFUSZ MPOH 3Y+BWBדךؒٓ٦Ⳣ椚  AdObservable(“λϚΰ”) .retry(1); // ྫ֎͕ൃੜͨ͠৔߹̍ճ͚ͩϦτϥΠ͢Δ

    SFUSZ 'VOD*OUFHFS 5ISPXBCMF #PPMFBOQSFEJDBUF AdObservable(“λϚΰ”) .retry((count, throwable) -> count > 2)
  78. 䎢デ׾《䖤ׅ׷0CTFSWBCMF׾何葺ׅ׷  
 public Observable<AdModel> searchAd(String keyword) { return Observable.create(subscriber

    -> { try{
 AdModel ad = AdClient.search(keyword); subscriber.onNext(ad); } catch(HttpException e) {
 subscriber.onError(e);
 }) .retry(1) .onErrorReturn(e -> { return AdModel.createEmptyData();
 }); } 䎢デ׾嗚稊ׅ׷0CTFSWBCMF׾刿ח何葺ׅ׷ ٔزٓ؎ך鷄⸇
  79. ٖءؾ《䖤ךؿٗ٦ ٖءؾ䞔㜠ך《䖤ؿٗ٦  ! ! ! ♥ ♥ ♥ չأذ٦ؗպד嗚稊

    أذ٦ؗךٖءؾ♧鋮׾《䖤 4FBSDI"1* -JLFך朐䡾׾《䖤 -JLF"1* ٖءؾر٦ةח-JLFך朐䡾׾و٦آ
  80. ٖءؾ《䖤ךؿٗ٦ ٖءؾ䞔㜠ך《䖤ؿٗ٦  ! ! ! ♥ ♥ ♥ չأذ٦ؗպד嗚稊

    أذ٦ؗךٖءؾ♧鋮׾《䖤 4FBSDI"1* -JLFך朐䡾׾《䖤 -JLF"1* ٖءؾر٦ةח-JLFך朐䡾׾و٦آ ꬊず劍Ⳣ椚ך湫⴨⻉
  81. 湫䱸Ⳣ椚ה⚛⴨Ⳣ椚׾穈׫さ׻ׇ׷ BU.BQ 'VOD TVQFS5  FYUFOET0CTFSWBCMF ⚛⴨Ⳣ椚ה湫⴨Ⳣ椚׾さ׻ׇג⢪ֲ searchRecipe(“εςʔΩ”)
 .flatMap(recipes ->

    
 Observable.combineLatest( Observable.just(recipes), // ϨγϐϦετΛͦͷ··౉͢
 fetchLikedRecipe(recipes)), //ϨγϐϦετ͔ΒLikeͨ͠ϨγϐIdΛऔಘ Pair::create
 )
 )
 .map(this::mergeLikeState) // mapͰLikeঢ়ଶΛϨγϐΠϯελϯεʹ൓өͤ͞Δ(লུ) .subscribe(recipes -> {}) 0CTFSWBCMFKVTU Y כծY׾0CTFSWBCMFחֻ׷׬׌ֽךًاحسדׅկ DPNCJOF-BUFTU 0CTFSWBCMF 0CTFSWBCMF 'VOD
  82. 湫䱸Ⳣ椚ה⚛⴨Ⳣ椚׾穈׫さ׻ׇ׷ BU.BQ 'VOD TVQFS5  FYUFOET0CTFSWBCMF ⚛⴨Ⳣ椚ה湫⴨Ⳣ椚׾さ׻ׇג⢪ֲ searchRecipe(“εςʔΩ”)
 .flatMap(recipes ->

    
 Observable.combineLatest( Observable.just(recipes), // ϨγϐϦετΛͦͷ··౉͢
 fetchLikedRecipe(recipes)), //ϨγϐϦετ͔ΒLikeͨ͠ϨγϐIdΛऔಘ Pair::create
 )
 )
 .map(this::mergeLikeState) // mapͰLikeঢ়ଶΛϨγϐΠϯελϯεʹ൓өͤ͞Δ(লུ) .subscribe(recipes -> {}) 0CTFSWBCMFKVTU Y כծY׾0CTFSWBCMFחֻ׷׬׌ֽךًاحسדׅկ DPNCJOF-BUFTU 0CTFSWBCMF 0CTFSWBCMF 'VOD
  83. 湫䱸Ⳣ椚ה⚛⴨Ⳣ椚׾穈׫さ׻ׇ׷ BU.BQ 'VOD TVQFS5  FYUFOET0CTFSWBCMF ⚛⴨Ⳣ椚ה湫⴨Ⳣ椚׾さ׻ׇג⢪ֲ searchRecipe(“εςʔΩ”)
 .flatMap(recipes ->

    
 Observable.combineLatest( Observable.just(recipes), // ϨγϐϦετΛͦͷ··౉͢
 fetchLikedRecipe(recipes)), //ϨγϐϦετ͔ΒLikeͨ͠ϨγϐIdΛऔಘ Pair::create
 )
 )
 .map(this::mergeLikeState) // mapͰLikeঢ়ଶΛϨγϐΠϯελϯεʹ൓өͤ͞Δ(লུ) .subscribe(recipes -> {}) 0CTFSWBCMFKVTU Y כծY׾0CTFSWBCMFחֻ׷׬׌ֽךًاحسדׅկ DPNCJOF-BUFTU 0CTFSWBCMF 0CTFSWBCMF 'VOD
  84. 鷄⸇项俱 BU.BQ 'VOD TVQFS5  FYUFOET0CTFSWBCMF 鷄⸇项俱 湫⴨Ⳣ椚׌ֽדאזּػة٦ٝ searchRecipe(“εςʔΩ”)
 .flatMap(recipes

    -> {
 fetchLikedRecipe(recipes)
 .map(likeIds -> {
 mergeLikeState(recipes, likeIds);
 });
 }
 ) .subscribe(recipes -> {}) IUUQTUXJUUFSDPNUBLVKJTUBUVTׁ׿ך׀䭷䶯鸐׶NBQד籬־ג׮״ׁ׉ֲדׅיկ
  85. -JLF朐䡾תד锃ץ׷ٖءؾ《䖤ًاحس׾⡲׷ public Observable<List<Recipe>> searchRecipeWithLikeState(String keyword) { searchRecipe(keyword) .flatMap(recipes -> Observable.combineLatest(

    Observable.just(recipes), fetchLikedRecipeIds(recipes)), Pair::create ) ) .map(this::mergeLikeState) }
 public Func1<List<Recipe>> mergeLikeState(Pair<List<Recipe>, Integer> pair) {
 // Likeঢ়ଶΛϨγϐΠϯελϯεʹ൓өͤ͞Δ(লུ)
 } ٖءؾ׾嗚稊 MJLF朐屣׾锃ץ׷ًاحس׾⡲׷
  86. 剑穄涸ז嗚稊歗꬗ךؿٗ٦ 嗚稊歗꬗ך剑穄涸זؿٗ٦㔳  ! ! ! ♥ ♥ ♥ չأذ٦ؗպד嗚稊

    أذ٦ؗךٖءؾ׾《䖤 أذ٦ؗꟼ鸬ך䎢デ׾《䖤 䖉׍さ׻ׇⳢ椚 ٖءؾך-JLF朐䡾׾《䖤
  87. 剑穄涸ז嗚稊歗꬗ךؿٗ٦ 嗚稊歗꬗ך剑穄涸זؿٗ٦㔳  ! ! ! ♥ ♥ ♥ չأذ٦ؗպד嗚稊

    أذ٦ؗךٖءؾ׾《䖤 أذ٦ؗꟼ鸬ך䎢デ׾《䖤 䖉׍さ׻ׇⳢ椚 ٖءؾך-JLF朐䡾׾《䖤
  88. 剑穄涸ז嗚稊歗꬗ךؿٗ٦ 嗚稊歗꬗ך剑穄涸זؿٗ٦㔳  ! ! ! ♥ ♥ ♥ չأذ٦ؗպד嗚稊

    أذ٦ؗךٖءؾ׾《䖤 أذ٦ؗꟼ鸬ך䎢デ׾《䖤 䖉׍さ׻ׇⳢ椚 ٖءؾך-JLF朐䡾׾《䖤
  89. 剑穄涸ז嗚稊歗꬗ךؿٗ٦ 嗚稊歗꬗ך剑穄涸זؿٗ٦㔳  ! ! ! ♥ ♥ ♥ չأذ٦ؗպד嗚稊

    أذ٦ؗךٖءؾ׾《䖤 أذ٦ؗꟼ鸬ך䎢デ׾《䖤 䖉׍さ׻ׇⳢ椚 ٖءؾך-JLF朐䡾׾《䖤 剑㣐㔐ךٔزٓ؎Ⳣ椚
  90. 剑穄涸ז嗚稊歗꬗ךؿٗ٦ 嗚稊歗꬗ך剑穄涸זؿٗ٦㔳  ! ! ! ♥ ♥ ♥ չأذ٦ؗպד嗚稊

    أذ٦ؗךٖءؾ׾《䖤 أذ٦ؗꟼ鸬ך䎢デ׾《䖤 䖉׍さ׻ׇⳢ椚 ٖءؾך-JLF朐䡾׾《䖤 㣟侁׃׋㜥さַ׵瑞ر٦ة׾鵤ׅ 剑㣐㔐ךٔزٓ؎Ⳣ椚
  91. 剑穄涸ז嗚稊歗꬗ךؿٗ٦ 嗚稊歗꬗ך剑穄涸זؿٗ٦㔳  ! ! ! ♥ ♥ ♥ չأذ٦ؗպד嗚稊

    أذ٦ؗךٖءؾ׾《䖤 أذ٦ؗꟼ鸬ך䎢デ׾《䖤 䖉׍さ׻ׇⳢ椚 ٖءؾך-JLF朐䡾׾《䖤 㣟侁׃׋㜥さַ׵瑞ر٦ة׾鵤ׅ 剑㣐㔐ךٔزٓ؎Ⳣ椚
  92. 剑穄涸ז嗚稊歗꬗ךؿٗ٦ 嗚稊歗꬗ך剑穄涸זؿٗ٦㔳  ! ! ! ♥ ♥ ♥ չأذ٦ؗպד嗚稊

    أذ٦ؗךٖءؾ׾《䖤 أذ٦ؗꟼ鸬ך䎢デ׾《䖤 䖉׍さ׻ׇⳢ椚 ٖءؾך-JLF朐䡾׾《䖤 㣟侁׃׋㜥さַ׵瑞ر٦ة׾鵤ׅ 剑㣐㔐ךٔزٓ؎Ⳣ椚
  93. 剑穄涸ז嗚稊歗꬗ךؿٗ٦ 嗚稊歗꬗ך剑穄涸זؿٗ٦㔳  ! ! ! ♥ ♥ ♥ չأذ٦ؗպד嗚稊

    ׅץגך䞔㜠 ٖءؾ -JLF朐䡾 䎢デ ָٔأزך邌爙ׁ׸׷ أذ٦ؗךٖءؾ׾《䖤 أذ٦ؗꟼ鸬ך䎢デ׾《䖤 䖉׍さ׻ׇⳢ椚 ٖءؾך-JLF朐䡾׾《䖤 㣟侁׃׋㜥さַ׵瑞ر٦ة׾鵤ׅ 剑㣐㔐ךٔزٓ؎Ⳣ椚
  94. 剑穄涸ז嗚稊歗꬗ך㹋鄲 Observable.combineLatest( searchRecipeWithLikeState(“εςʔΩ”) .subscribeOn(schedulers.io()), searchAd(“εςʔΩ”) .subscribeOn(schedulers.io()), Pair::create ) .compose(bindToLifecycle())
 .subscribeOn(schedulers.io())


    .observeOn(AndroidSchedulers.mainThread()) .subscribe(pair -> { addToList(pair.first, pair.second); }, throwable -> { showErrorMessage(t); } ); ٖءؾ׾嗚稊MJLF朐屣׾《䖤 ꟼ鸬䎢デך嗚稊  ! ! ! ♥ ♥ ♥ 醱꧟זⳢ椚ד֮׏ג׮؝٦سך〳铣䚍ָ䬐⥂ׁ׸׷ךָ3Y+BWB׾ⵃ欽ׅ׷눁⸂דׅיկ
  95. ֶׁ׵ְ DPNCJOF-BUFTU 0CTFSWBCMF 0CTFSWBCMF 'VOD 3Y+BWBדך⚛⴨Ⳣ椚 Observable.combineLatest(
 Observable.just(1),
 Observable.just(2),
 (i1,i2)

    -> i1 + i2
 ); ♳ך⢽דכאך0CTFSWBCMFך䖉׍さ׻ׇדָׅծ
 _ /⦐ך䖉׍さ׻ׇָ⳿勻׷ًاحسָ欽䠐ׁ׸גְתׅ
  96. 3Y+BWBדך湫⴨⻉ BU.BQ 'VOD TVQFS5  FYUFOET0CTFSWBCMF 3Y+BWBדך湫⴨Ⳣ椚 searchRecipe(“εςʔΩ”) .flatMap(recipes ->

    recipeClient.fetchLikedRecipeIds(recipes)) .subscribe(recipeIds -> {}) BU.BQכծBU.BQ 0CTFSWBCMFGSPN דٔأز׾ぐ銲稆חⴓⶴׅ׷儗ח׮⢪ְתׅկ
  97. ⚛⴨Ⳣ椚ך䘔欽 א⟃♳ך⚛⴨Ⳣ椚׾遤ְ㜥さ אך0CTFSWBCMF׾DPNCJOF-BUFTUד䖉׍さ׻ׇׅ׷㜥さחכծ
 1BJSד⦼׾さ䧭׃תָׅծא⟃♳ך㜥さכ1BJS׾䭁䓸׃׋5VQMF  5VQM׾荈⵸ד⡲׏גⵃ欽׃גתׅկ public class Tuple3<T1, T2,

    T3> {
 public T1 first; public T2 second; public T3 third;
 public Tuple3(T1 first, T2 second, T3 third) {
 this.first = first;
 this.second = second;
 this.third = third;
 }
 public static <T1, T2, T3> Tuple3<T1, T2, T3> create(T1 t1, T2 t2, T3 t3) {
 return new Tuple3<>(t1, t2, t3);
 }
 } 5VQMF׮♧儗劍֮׶ת׃׋ָծ5VQMFתד֮׸ל㣐䫺ך銲⟝׾弫׋ׇ׉ֲדׅկ
  98. 暴婊ז0CTFSWBCMF 4JOHMF !#FUB 暴婊ז欽鷿ך0CTFSWBCMF )UUQؙٔؒأزזו♧䏝׃ַ؎كٝزָ崧׸גֿזְ0CTFSWBCMF ➭鎉铂ד鎉ֲהֿ׹ך1SPNJTF׫׋ְז׮ך Single.create(subscriber -> {
 subscriber.onSuccess("Hello

    world");
 }).subscribe(text -> {
 System.out.println(text);
 }, throwable -> {
 Crashlytics.logException(e);
 }); 劤أٓ؎سד0CTFSWBCMF׾⢪׏׋הֿ׹כⰋג4JOHMFח剅ֹ䳔ִ׷ֿהָ⳿勻תׅկ
  99. 暴婊ז0CTFSWBCMF $PNQMFUBCMF !&YQFSJNFOUBM 暴婊ז欽鷿ך0CTFSWBCMF 1045ؙٔؒأزזוծ暴ח⦼ָ鵤׏גֿזְ㜥さך0CTFSWBCMFך
 䧭⸆PS㣟侁׌ֽ׾濼׶׋ְ㜥さח⢪ֲկ⦼כ♧ⴖ崧׸גֿזְկ Completable.create(subscriber -> { 


    subscriber.onCompleted()
 }).subscribe(throwable -> {
 Crashlytics.logException(e);
 }, () -> {
 
 }); 暴ח䗳銲זְךח3FTQPOTFװOVMM׾床ׅז׵ծ4JOHMFװ$PNQMFUBCMF׾♳䩛ֻ⢪ְ׋ְדׅיկ